- Commit
- 49e015cdac778bf82baeb41f1b204668980c635b
- Parent
- 3494245c36805c24c68996551dc77a5438ae2e8f
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
render: added cmark_render_ascii, to be used in char escapers.
My personal build of CMark ✏️
render: added cmark_render_ascii, to be used in char escapers.
2 files changed, 12 insertions, 0 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | src/render.c | 9 | 9 | 0 |
Modified | src/render.h | 3 | 3 | 0 |
diff --git 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 @@ -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,