summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-12 16:13:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-12 16:13:02 -0700
commit49e015cdac778bf82baeb41f1b204668980c635b (patch)
treec408cac4d47f58eac6b3af6fa1179c9bc740cefc /src
parent3494245c36805c24c68996551dc77a5438ae2e8f (diff)
render: added cmark_render_ascii, to be used in char escapers.
Diffstat (limited to 'src')
-rw-r--r--src/render.c9
-rw-r--r--src/render.h3
2 files changed, 12 insertions, 0 deletions
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,