diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-29 18:58:52 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-29 18:58:52 +0000 |
commit | cd3f87782ffba7533bf3f5c52b02192aa287533b (patch) | |
tree | f9956f93b246da68aaee48674816f5ab7db5535e | |
parent | 856ccfd0e453b0e0b926d34de280f8e2649d3da6 (diff) | |
download | mandoc-cd3f87782ffba7533bf3f5c52b02192aa287533b.tar.gz |
Moved printing of empty word [back] into mdoc_action.c so that it's not
mirrored across front-ends.
-rw-r--r-- | mdoc_action.c | 24 | ||||
-rw-r--r-- | mdoc_html.c | 2 | ||||
-rw-r--r-- | mdoc_term.c | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/mdoc_action.c b/mdoc_action.c index 00e5b8cc..9ac5e604 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -57,6 +57,7 @@ static int post_dd(POST_ARGS); static int post_display(POST_ARGS); static int post_dt(POST_ARGS); static int post_lb(POST_ARGS); +static int post_li(POST_ARGS); static int post_nm(POST_ARGS); static int post_os(POST_ARGS); static int post_pa(POST_ARGS); @@ -102,7 +103,7 @@ static const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Ft */ { NULL, NULL }, /* Ic */ { NULL, NULL }, /* In */ - { NULL, NULL }, /* Li */ + { NULL, post_li }, /* Li */ { NULL, NULL }, /* Nd */ { NULL, post_nm }, /* Nm */ { NULL, NULL }, /* Op */ @@ -837,6 +838,27 @@ post_pa(POST_ARGS) /* + * Empty `Li' macros get an empty string to make front-ends add an extra + * space. + */ +static int +post_li(POST_ARGS) +{ + struct mdoc_node *np; + + if (n->child) + return(1); + + np = n; + m->next = MDOC_NEXT_CHILD; + if ( ! mdoc_word_alloc(m, n->line, n->pos, "")) + return(0); + m->last = np; + return(1); +} + + +/* * The `Ar' macro defaults to two strings "file ..." if no value is * provided as an argument. */ diff --git a/mdoc_html.c b/mdoc_html.c index e0db3832..22011403 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -2091,8 +2091,6 @@ mdoc_li_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "lit"); print_otag(h, TAG_SPAN, 1, &tag); - if (NULL == n->child) - print_text(h, ""); return(1); } diff --git a/mdoc_term.c b/mdoc_term.c index 65c39277..943a880d 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -2098,8 +2098,6 @@ termp_li_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_NONE); - if (NULL == n->child) - term_word(p, ""); return(1); } |