aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-25 12:37:20 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-25 12:37:20 +0000
commit5909cbca3fe375aeac1e2247b3f8edbaba32e56e (patch)
tree22379e2aa842475f26d517eadfe52749991a4340 /mdoc.c
parent2aefdbffeeeeda1b600266dae034d7133292ad46 (diff)
downloadmandoc-5909cbca3fe375aeac1e2247b3f8edbaba32e56e.tar.gz
mandoc-5909cbca3fe375aeac1e2247b3f8edbaba32e56e.tar.zst
mandoc-5909cbca3fe375aeac1e2247b3f8edbaba32e56e.zip
Modified version of Ingo Schwarze's patch for hyphen-breaking.
Breakable hyphens are cued in the back-ends (with ASCII_HYPH) and acted upon in term.c or ignored in html.c. Also cleaned up XML decl printing (no need for extra vars).
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdoc.c b/mdoc.c
index 19920954..e67462e0 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.137 2010/05/24 13:39:47 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.138 2010/05/25 12:37:20 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -563,6 +563,10 @@ mdoc_ptext(struct mdoc *m, int line, char *buf, int offs)
ws = NULL;
for (c = end = buf + offs; *c; c++) {
switch (*c) {
+ case '-':
+ if (mandoc_hyph(buf + offs, c))
+ *c = ASCII_HYPH;
+ break;
case ' ':
if (NULL == ws)
ws = c;