summaryrefslogtreecommitdiff
path: root/src/html.c
diff options
context:
space:
mode:
authorPavlo Kapyshin <i@93z.org>2016-03-18 10:25:23 +0200
committerPavlo Kapyshin <i@93z.org>2016-03-18 10:28:22 +0200
commitec64e9ea899c3f40e26aec8bfc4a9b8941b91cdf (patch)
treee3b94e4fe4de517f930c193bcd9cf47839e2f455 /src/html.c
parentc4eb6bc33d9639ce0840a5fa3cea173c2c816fd1 (diff)
Add library option to render softbreaks as spaces
Diffstat (limited to 'src/html.c')
-rw-r--r--src/html.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/html.c b/src/html.c
index 9ffa08a..c2267cb 100644
--- a/src/html.c
+++ b/src/html.c
@@ -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');
}