diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-07-12 16:55:22 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-07-12 16:55:22 -0700 |
commit | 9e154368dd8cb9a1a00340c2210722f22160c402 (patch) | |
tree | 1ccad9f306f4df5d69df29e2d71bc13948245bcc /src/man.c | |
parent | 364c683fed6269c9b21ed870a8666e2de7121335 (diff) |
Added cmark_render_code_point.
Diffstat (limited to 'src/man.c')
-rw-r--r-- | src/man.c | 33 |
1 files changed, 14 insertions, 19 deletions
@@ -14,7 +14,6 @@ #define LIT(s) renderer->out(renderer, s, false, LITERAL) #define CR() renderer->cr(renderer) #define BLANKLINE() renderer->blankline(renderer) -#define ASCII(s) cmark_render_ascii(renderer, s) // Functions to convert cmark_nodes to groff man strings. static @@ -26,55 +25,51 @@ void S_outc(cmark_renderer *renderer, (void)(nextc); if (escape == LITERAL) { - utf8proc_encode_char(c, renderer->buffer); - renderer->column += 1; + cmark_render_code_point(renderer, c); return; } switch(c) { case 46: if (renderer->begin_line) { - ASCII("\\&."); + cmark_render_ascii(renderer, "\\&."); } else { - utf8proc_encode_char(c, renderer->buffer); - renderer->column += 1; + cmark_render_code_point(renderer, c); } break; case 39: if (renderer->begin_line) { - ASCII("\\&'"); + cmark_render_ascii(renderer, "\\&'"); } else { - utf8proc_encode_char(c, renderer->buffer); - renderer->column += 1; + cmark_render_code_point(renderer, c); } break; case 45: - ASCII("\\-"); + cmark_render_ascii(renderer, "\\-"); break; case 92: - ASCII("\\e"); + cmark_render_ascii(renderer, "\\e"); break; case 8216: // left single quote - ASCII("\\[oq]"); + cmark_render_ascii(renderer, "\\[oq]"); break; case 8217: // right single quote - ASCII("\\[cq]"); + cmark_render_ascii(renderer, "\\[cq]"); break; case 8220: // left double quote - ASCII("\\[lq]"); + cmark_render_ascii(renderer, "\\[lq]"); break; case 8221: // right double quote - ASCII("\\[rq]"); + cmark_render_ascii(renderer, "\\[rq]"); break; case 8212: // em dash - ASCII("\\[em]"); + cmark_render_ascii(renderer, "\\[em]"); break; case 8211: // en dash - ASCII("\\[en]"); + cmark_render_ascii(renderer, "\\[en]"); break; default: - utf8proc_encode_char(c, renderer->buffer); - renderer->column += 1; + cmark_render_code_point(renderer, c); } renderer->begin_line = (c == 10); } |