summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-01-05 18:59:37 +0000
committerschwarze <schwarze@openbsd.org>2019-01-05 18:59:37 +0000
commit5c01bbd0d9a01c1fd2cd160f55509ba0a0560204 (patch)
treedf277cf672b9056c233407e6fd5f0d6e93cb6945 /usr.bin/mandoc/man_macro.c
parentfix previous commit (diff)
downloadwireguard-openbsd-5c01bbd0d9a01c1fd2cd160f55509ba0a0560204.tar.xz
wireguard-openbsd-5c01bbd0d9a01c1fd2cd160f55509ba0a0560204.zip
In HTML output, man(7) .RS blocks get formatted as <div class="Bd-indent">,
and i can see no reasonable alternative: they do indeed represent indented displays. They certainly require flow context and make no sense in phrasing context. Consequently, they have to suspend no-fill mode during their head, in just the same way as other paragraph-type macros do it. This fixes HTML syntax errors that resulted from .nf followed by .RS.
Diffstat (limited to 'usr.bin/mandoc/man_macro.c')
-rw-r--r--usr.bin/mandoc/man_macro.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c
index efdfb250679..dc0bcfda256 100644
--- a/usr.bin/mandoc/man_macro.c
+++ b/usr.bin/mandoc/man_macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_macro.c,v 1.105 2019/01/05 00:36:46 schwarze Exp $ */
+/* $OpenBSD: man_macro.c,v 1.106 2019/01/05 18:59:37 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -295,8 +295,10 @@ blk_exp(MACRO_PROT_ARGS)
char *p;
int la;
- if (tok == MAN_RS)
+ if (tok == MAN_RS) {
rew_scope(man, tok);
+ man->flags |= ROFF_NONOFILL;
+ }
roff_block_alloc(man, line, ppos, tok);
head = roff_head_alloc(man, line, ppos, tok);
@@ -320,6 +322,7 @@ blk_exp(MACRO_PROT_ARGS)
man_unscope(man, head);
roff_body_alloc(man, line, ppos, tok);
+ man->flags &= ~ROFF_NONOFILL;
}
/*