source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* docbook2mdoc: avoid overquoting when <literal> is nested inside <quote>
@ 2019-04-14 18:29 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-14 18:29 UTC (permalink / raw)
  To: source

Log Message:
-----------
avoid overquoting when <literal> is nested inside <quote>

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        statistics.c

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.121 -r1.122
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -1122,8 +1122,10 @@ pnode_print(struct format *f, struct pno
 		pnode_printlink(f, n);
 		break;
 	case NODE_LITERAL:
-		if (was_impl)
-			macro_open(f, "So");
+		if (n->parent != NULL && n->parent->node == NODE_QUOTE)
+			macro_open(f, "Li");
+		else if (was_impl)
+			macro_open(f, "So Li");
 		else {
 			macro_open(f, "Ql");
 			f->flags |= FMT_IMPL;
@@ -1268,7 +1270,9 @@ pnode_print(struct format *f, struct pno
 		macro_line(f, "EN");
 		break;
 	case NODE_LITERAL:
-		if (was_impl) {
+		if (n->parent != NULL && n->parent->node == NODE_QUOTE)
+			/* nothing */;
+		else if (was_impl) {
 			f->flags &= ~FMT_NOSPC;
 			macro_open(f, "Sc");
 		} else
Index: statistics.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -Lstatistics.c -Lstatistics.c -u -p -r1.27 -r1.28
--- statistics.c
+++ statistics.c
@@ -483,6 +483,7 @@ main(int argc, char *argv[])
 		table_add("programlisting", NULL);
 		table_add("property", "TEXT");
 		table_add("pubdate", "TEXT");
+		table_add("quote", "literal");
 		table_add("quote", "TEXT");
 		table_add("refentry", "refentryinfo");
 		table_add("refentry", "refmeta");
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-14 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 18:29 docbook2mdoc: avoid overquoting when <literal> is nested inside <quote> schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).