summaryrefslogtreecommitdiff
path: root/src/man.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-12 16:55:22 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-12 16:55:22 -0700
commit9e154368dd8cb9a1a00340c2210722f22160c402 (patch)
tree1ccad9f306f4df5d69df29e2d71bc13948245bcc /src/man.c
parent364c683fed6269c9b21ed870a8666e2de7121335 (diff)
Added cmark_render_code_point.
Diffstat (limited to 'src/man.c')
-rw-r--r--src/man.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/man.c b/src/man.c
index 6fe666d..b2e0ce2 100644
--- a/src/man.c
+++ b/src/man.c
@@ -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);
}