summaryrefslogtreecommitdiff
path: root/src/xml.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-04 09:01:53 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-04 09:01:53 -0800
commitfce432fbc761ab2fa9d349239324d5cf68abf563 (patch)
tree1d95af4cc579236228856ababb5f0d507fdc0d7e /src/xml.c
parent790810db9e4368451c5c5298f13e3ba882d8568a (diff)
xml writer - fixed issues with empty images.
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/xml.c b/src/xml.c
index b012886..1577f89 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -103,20 +103,16 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
} else if (!literal) {
cmark_strbuf_puts(xml, " /");
}
+ cmark_strbuf_puts(xml, ">\n");
- } else {
- if (node->first_child) {
+
+ } else if (node->first_child) {
state->indent -= 2;
- }
- indent(state);
- cmark_strbuf_printf(xml, "</%s",
- cmark_node_get_type_string(node));
+ indent(state);
+ cmark_strbuf_printf(xml, "</%s>\n",
+ cmark_node_get_type_string(node));
}
- // TODO print attributes
-
- cmark_strbuf_puts(xml, ">\n");
-
return 1;
}