From 00ae2c61a47e09bb7643f0a7153c2009b7537e09 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 19 Dec 2015 15:26:18 -0800 Subject: Added RAW_BLOCK and RAW_INLINE node types. These are passed through verbatim by all writers, with no escaping. They are never generated by the parser, and do not correspond to CommonMark elements. They are designed to be inserted by filters that postprocess the AST. For example, a filter might convert specially marked code blocks to svg diagrams in HTML and tikz diagrams in LaTeX, passing these through to the renderer as a RAW_BLOCK. --- src/html.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/html.c') diff --git a/src/html.c b/src/html.c index dfe2aec..4fa4437 100644 --- a/src/html.c +++ b/src/html.c @@ -176,6 +176,12 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, cr(html); break; + case CMARK_NODE_RAW_BLOCK: + cr(html); + cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len); + cr(html); + break; + case CMARK_NODE_HRULE: cr(html); cmark_strbuf_puts(html, "as.literal.data, node->as.literal.len); + break; + case CMARK_NODE_STRONG: if (entering) { cmark_strbuf_puts(html, ""); -- cgit v1.2.3