diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-01-17 13:22:04 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-01-17 13:22:04 -0800 |
commit | 8c75cce5e755799c743699286403440d10b42bbd (patch) | |
tree | 75001159e53edeac703ac462f2b20603c64ff628 /src | |
parent | 54bc9903cff53399c4bc67be0d1b842201863f83 (diff) |
commonmark renderer: use 4-space indent for bullet lists.
This makes the output compatible with more implementations.
Diffstat (limited to 'src')
-rw-r--r-- | src/commonmark.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/commonmark.c b/src/commonmark.c index f19db3f..55ca037 100644 --- a/src/commonmark.c +++ b/src/commonmark.c @@ -201,7 +201,7 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node, case CMARK_NODE_ITEM: if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) { - marker_width = 2; + marker_width = 4; } else { list_number = cmark_node_get_list_start(node->parent); list_delim = cmark_node_get_list_delim(node->parent); @@ -220,15 +220,14 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node, } if (entering) { if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) { - LIT("* "); + LIT(" - "); renderer->begin_content = true; - cmark_strbuf_puts(renderer->prefix, " "); } else { LIT(listmarker); renderer->begin_content = true; - for (i = marker_width; i--;) { - cmark_strbuf_putc(renderer->prefix, ' '); - } + } + for (i = marker_width; i--;) { + cmark_strbuf_putc(renderer->prefix, ' '); } } else { cmark_strbuf_truncate(renderer->prefix, |