summaryrefslogtreecommitdiff
path: root/src/xml.c
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2015-01-05 16:45:38 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2015-01-05 16:45:38 -0800
commit1b6afb7654d29eced20de720d7b5d37fb861bad3 (patch)
tree8040843b983640d9afa69a8478b26231169afa53 /src/xml.c
parent9a5c98fe0d6de2a1a940bc8b3209ba0c4fadf7c4 (diff)
Reformatted code consistently with astyle.
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/xml.c b/src/xml.c
index 1577f89..2ae900c 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -36,7 +36,7 @@ static inline void indent(struct render_state *state)
static int
S_render_node(cmark_node *node, cmark_event_type ev_type,
- struct render_state *state, long options)
+ struct render_state *state, long options)
{
cmark_strbuf *xml = state->xml;
bool literal = false;
@@ -46,14 +46,14 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
if (entering) {
indent(state);
cmark_strbuf_printf(xml, "<%s",
- cmark_node_get_type_string(node));
+ cmark_node_get_type_string(node));
if (options & CMARK_OPT_SOURCEPOS && node->start_line != 0) {
cmark_strbuf_printf(xml, " sourcepos=\"%d:%d-%d:%d\"",
- node->start_line,
- node->start_column,
- node->end_line,
- node->end_column);
+ node->start_line,
+ node->start_column,
+ node->end_line,
+ node->end_column);
}
literal = false;
@@ -65,25 +65,25 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
case CMARK_NODE_INLINE_HTML:
cmark_strbuf_puts(xml, ">");
escape_xml(xml, node->as.literal.data,
- node->as.literal.len);
+ node->as.literal.len);
cmark_strbuf_puts(xml, "</");
cmark_strbuf_puts(xml,
- cmark_node_get_type_string(node));
+ cmark_node_get_type_string(node));
literal = true;
break;
case CMARK_NODE_CODE_BLOCK:
if (node->as.code.info.len > 0) {
cmark_strbuf_puts(xml, " info=\"");
escape_xml(xml, node->as.code.info.data,
- node->as.code.info.len);
+ node->as.code.info.len);
cmark_strbuf_putc(xml, '"');
}
cmark_strbuf_puts(xml, ">");
escape_xml(xml, node->as.code.literal.data,
- node->as.code.literal.len);
+ node->as.code.literal.len);
cmark_strbuf_puts(xml, "</");
cmark_strbuf_puts(xml,
- cmark_node_get_type_string(node));
+ cmark_node_get_type_string(node));
literal = true;
break;
case CMARK_NODE_LINK:
@@ -107,10 +107,10 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
} else if (node->first_child) {
- state->indent -= 2;
- indent(state);
- cmark_strbuf_printf(xml, "</%s>\n",
- cmark_node_get_type_string(node));
+ state->indent -= 2;
+ indent(state);
+ cmark_strbuf_printf(xml, "</%s>\n",
+ cmark_node_get_type_string(node));
}
return 1;
@@ -126,9 +126,9 @@ char *cmark_render_xml(cmark_node *root, long options)
cmark_iter *iter = cmark_iter_new(root);
cmark_strbuf_puts(state.xml,
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
cmark_strbuf_puts(state.xml,
- "<!DOCTYPE CommonMark SYSTEM \"CommonMark.dtd\">\n");
+ "<!DOCTYPE CommonMark SYSTEM \"CommonMark.dtd\">\n");
while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
cur = cmark_iter_get_node(iter);
S_render_node(cur, ev_type, &state, options);