From 49e015cdac778bf82baeb41f1b204668980c635b Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Sun, 12 Jul 2015 16:13:02 -0700 Subject: render: added cmark_render_ascii, to be used in char escapers. --- src/render.c | 9 +++++++++ src/render.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/render.c b/src/render.c index fb49248..e1545ea 100644 --- a/src/render.c +++ b/src/render.c @@ -116,6 +116,15 @@ void S_out(cmark_renderer *renderer, } } +// Assumes no newlines, assumes ascii content: +void +cmark_render_ascii(cmark_renderer* renderer, const char* s) +{ + int origsize = renderer->buffer->size; + cmark_strbuf_puts(renderer->buffer, s); + renderer->column += renderer->buffer->size - origsize; +} + char* cmark_render(cmark_node *root, int options, diff --git a/src/render.h b/src/render.h index d050962..17728b6 100644 --- a/src/render.h +++ b/src/render.h @@ -40,6 +40,9 @@ struct cmark_renderer { typedef struct cmark_renderer cmark_renderer; +void +cmark_render_ascii(cmark_renderer *renderer, const char* s); + char* cmark_render(cmark_node *root, int options, -- cgit v1.2.3