[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandoc-source
Subject:    mdocml: Moved printing of empty word [back] into mdoc_action.c so that
From:       kristaps () mdocml ! bsd ! lv
Date:       2010-05-29 18:58:52
Message-ID: 201005291858.o4TIwqF0029964 () krisdoz ! my ! domain
[Download RAW message or body]

Log Message:
-----------
Moved printing of empty word [back] into mdoc_action.c so that it's not
mirrored across front-ends.

Modified Files:
--------------
    mdocml:
        mdoc_action.c
        mdoc_html.c
        mdoc_term.c

Revision Data
-------------
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.68 -r1.69
--- mdoc_html.c
+++ 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);
 }
 
Index: mdoc_action.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_action.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -Lmdoc_action.c -Lmdoc_action.c -u -p -r1.61 -r1.62
--- mdoc_action.c
+++ 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
 	{ 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 */
@@ -830,6 +831,27 @@ post_pa(POST_ARGS)
 	m->next = MDOC_NEXT_CHILD;
 	/* XXX: make into macro value. */
 	if ( ! mdoc_word_alloc(m, n->line, n->pos, "~"))
+		return(0);
+	m->last = np;
+	return(1);
+}
+
+
+/*
+ * 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);
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.132 -r1.133
--- mdoc_term.c
+++ 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);
 }
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic