From d6077ea037e23f6e2c0d83dda7b5d7106f48d1a3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 Dec 2014 12:05:04 -0800 Subject: Re-added cmark_ prefix to strbuf and chunk. Reverts 225d720. --- src/html.c | 94 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'src/html.c') diff --git a/src/html.c b/src/html.c index 34552bf..b007d67 100644 --- a/src/html.c +++ b/src/html.c @@ -11,7 +11,7 @@ // Functions to convert cmark_nodes to HTML strings. -static void escape_html(strbuf *dest, const unsigned char *source, int length) +static void escape_html(cmark_strbuf *dest, const unsigned char *source, int length) { if (length < 0) length = strlen((char *)source); @@ -19,7 +19,7 @@ static void escape_html(strbuf *dest, const unsigned char *source, int length) houdini_escape_html0(dest, source, (size_t)length, 0); } -static void escape_href(strbuf *dest, const unsigned char *source, int length) +static void escape_href(cmark_strbuf *dest, const unsigned char *source, int length) { if (length < 0) length = strlen((char *)source); @@ -27,14 +27,14 @@ static void escape_href(strbuf *dest, const unsigned char *source, int length) houdini_escape_href(dest, source, (size_t)length); } -static inline void cr(strbuf *html) +static inline void cr(cmark_strbuf *html) { if (html->size && html->ptr[html->size - 1] != '\n') - strbuf_putc(html, '\n'); + cmark_strbuf_putc(html, '\n'); } struct render_state { - strbuf* html; + cmark_strbuf* html; cmark_node *plain; }; @@ -44,7 +44,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate) struct render_state *state = vstate; cmark_node *parent; cmark_node *grandparent; - strbuf *html = state->html; + cmark_strbuf *html = state->html; char start_header[] = ""; char end_header[] = ""; bool tight; @@ -66,7 +66,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate) case CMARK_NODE_LINEBREAK: case CMARK_NODE_SOFTBREAK: - strbuf_putc(html, ' '); + cmark_strbuf_putc(html, ' '); break; default: @@ -82,10 +82,10 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate) case CMARK_NODE_BLOCK_QUOTE: if (entering) { cr(html); - strbuf_puts(html, "
\n"); + cmark_strbuf_puts(html, "
\n"); } else { cr(html); - strbuf_puts(html, "
\n"); + cmark_strbuf_puts(html, "
\n"); } break; @@ -96,17 +96,17 @@ S_render_node(cmark_node *node, cmark_event_type ev_type, void *vstate) if (entering) { cr(html); if (list_type == CMARK_BULLET_LIST) { - strbuf_puts(html, "