summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-29 18:58:52 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-29 18:58:52 +0000
commit1cfb674e05b4b5cd36e7ff8b437258f2421e4c49 (patch)
tree07918b10def0c34d4bc1df060fc7b2aa4dee87c2 /mdoc_action.c
parent08bcb731d82732ede8c159ba0d53a5f65c1fd37d (diff)
downloadmandoc-1cfb674e05b4b5cd36e7ff8b437258f2421e4c49.tar.gz
mandoc-1cfb674e05b4b5cd36e7ff8b437258f2421e4c49.tar.zst
mandoc-1cfb674e05b4b5cd36e7ff8b437258f2421e4c49.zip
Moved printing of empty word [back] into mdoc_action.c so that it's not
mirrored across front-ends.
Diffstat (limited to 'mdoc_action.c')
-rw-r--r--mdoc_action.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index 76003caf..7fa1bf6b 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_action.c,v 1.61 2010/05/24 11:59:37 joerg Exp $ */
+/* $Id: mdoc_action.c,v 1.62 2010/05/29 18:58:52 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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.
*/