summaryrefslogtreecommitdiff
path: root/src/man.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/man.c')
-rw-r--r--src/man.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/man.c b/src/man.c
index 970bb6d..b7cb932 100644
--- a/src/man.c
+++ b/src/man.c
@@ -7,10 +7,11 @@
#include "cmark.h"
#include "node.h"
#include "buffer.h"
-#include "smart.h"
// Functions to convert cmark_nodes to groff man strings.
+// TODO: properly escape unicode punctuation used in smart mode:
+// "\\[lq]", "\\[rq]", "\\[oq]", "\\[cq]", "\\[em]", "\\[en]", "..."
static void escape_man(cmark_strbuf *dest, const unsigned char *source, int length)
{
int i;
@@ -47,7 +48,7 @@ struct render_state {
static int
S_render_node(cmark_node *node, cmark_event_type ev_type,
- struct render_state *state, long options)
+ struct render_state *state)
{
cmark_node *tmp;
cmark_strbuf *man = state->man;
@@ -166,14 +167,8 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
break;
case CMARK_NODE_TEXT:
- if (options & CMARK_OPT_SMARTPUNCT) {
- escape_with_smart(man, node, escape_man,
- "\\[lq]", "\\[rq]", "\\[oq]", "\\[cq]",
- "\\[em]", "\\[en]", "...");
- } else {
- escape_man(man, node->as.literal.data,
- node->as.literal.len);
- }
+ escape_man(man, node->as.literal.data,
+ node->as.literal.len);
break;
case CMARK_NODE_LINEBREAK:
@@ -248,7 +243,7 @@ char *cmark_render_man(cmark_node *root, long options)
while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
cur = cmark_iter_get_node(iter);
- S_render_node(cur, ev_type, &state, options);
+ S_render_node(cur, ev_type, &state);
}
result = (char *)cmark_strbuf_detach(&man);