diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmark.h | 4 | ||||
-rw-r--r-- | src/html.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h index 71c634b..7b7001e 100644 --- a/src/cmark.h +++ b/src/cmark.h @@ -519,6 +519,10 @@ char *cmark_render_latex(cmark_node *root, int options, int width); */ #define CMARK_OPT_SAFE (1 << 3) +/** Render `softbreak` elements as spaces. + */ +#define CMARK_OPT_NOBREAKS (1 << 4) + /** * ### Options affecting parsing */ @@ -228,6 +228,8 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, case CMARK_NODE_SOFTBREAK: if (options & CMARK_OPT_HARDBREAKS) { cmark_strbuf_puts(html, "<br />\n"); + } else if (options & CMARK_OPT_NOBREAKS) { + cmark_strbuf_putc(html, ' '); } else { cmark_strbuf_putc(html, '\n'); } |