summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roff.76
-rw-r--r--roff.c9
2 files changed, 14 insertions, 1 deletions
diff --git a/roff.7 b/roff.7
index 7d9a7f3e..12455f8d 100644
--- a/roff.7
+++ b/roff.7
@@ -1819,6 +1819,12 @@ is an unpaddable space-sized non-breaking space character; see
.Ss \e\(dq
The rest of the input line is treated as
.Sx Comments .
+.Ss \e#
+Line continuation with comment.
+Discard the rest of the physical input line and continue the logical
+input line on the next physical input line, joining the text on
+both lines together as if it were on a single input line.
+This is a groff extension.
.Ss \e%
Hyphenation allowed at this point of the word; ignored by
.Xr mandoc 1 .
diff --git a/roff.c b/roff.c
index 91f4b1fb..705fddeb 100644
--- a/roff.c
+++ b/roff.c
@@ -1205,7 +1205,14 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos)
r->man->next = ROFF_NEXT_SIBLING;
}
- /* Discard comments. */
+ /* Line continuation with comment. */
+
+ if (stesc[1] == '#') {
+ *stesc = '\0';
+ return ROFF_APPEND;
+ }
+
+ /* Discard normal comments. */
while (stesc > start && stesc[-1] == ' ')
stesc--;