summaryrefslogtreecommitdiff
path: root/src/xml.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-09-14 10:18:17 -0700
committerGitHub <noreply@github.com>2018-09-14 10:18:17 -0700
commit42cd5230d423f20f9367754975d10f6ddf4c0430 (patch)
treeeb4ebff693c53e46e56dc1fcfe3a3b11806b8bfd /src/xml.c
parentc44bced3ad5aaad1e32441677873693e46d354e1 (diff)
parent55afc6fd496de4e75c27d725c2bf1470cc3cf5aa (diff)
Merge pull request #257 from pclouds/xml-space-preserve
Add xml:space="preserve" in XML output when appropriate
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xml.c b/src/xml.c
index 4898cd2..48674cc 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -60,7 +60,7 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
case CMARK_NODE_CODE:
case CMARK_NODE_HTML_BLOCK:
case CMARK_NODE_HTML_INLINE:
- cmark_strbuf_puts(xml, ">");
+ cmark_strbuf_puts(xml, " xml:space=\"preserve\">");
escape_xml(xml, node->as.literal.data, node->as.literal.len);
cmark_strbuf_puts(xml, "</");
cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
@@ -100,7 +100,7 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
escape_xml(xml, node->as.code.info.data, node->as.code.info.len);
cmark_strbuf_putc(xml, '"');
}
- cmark_strbuf_puts(xml, ">");
+ cmark_strbuf_puts(xml, " xml:space=\"preserve\">");
escape_xml(xml, node->as.code.literal.data, node->as.code.literal.len);
cmark_strbuf_puts(xml, "</");
cmark_strbuf_puts(xml, cmark_node_get_type_string(node));