aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-10-25 01:32:40 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-10-25 01:32:40 +0000
commit6d7bd68376bb91e0b5c2ea4ec175b367ed946fc5 (patch)
treeb0f9734269df7b90bac3701dd8a4ac62cc8550f0 /mandoc.c
parenta93cab0159f106fce2adae204f5e9a1011800296 (diff)
downloadmandoc-6d7bd68376bb91e0b5c2ea4ec175b367ed946fc5.tar.gz
mandoc-6d7bd68376bb91e0b5c2ea4ec175b367ed946fc5.tar.zst
mandoc-6d7bd68376bb91e0b5c2ea4ec175b367ed946fc5.zip
Implement the \f(CW and \f(CR (constant width font) escape sequences
for HTML output. Somewhat relevant because pod2man(1) relies on this. Missing feature reported by Pali dot Rohar at gmail dot com. Note that constant width font was already correctly selected before this when required by semantic markup. Only attempting physical markup with the low-level escape sequence was ineffective.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mandoc.c b/mandoc.c
index e3521448..5476fb41 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.107 2018/08/20 18:06:56 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.108 2018/10/25 01:32:40 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -304,8 +304,13 @@ mandoc_escape(const char **end, const char **start, int *sz)
case ESCAPE_FONT:
if (*sz == 2) {
if (**start == 'C') {
+ if ((*start)[1] == 'W' ||
+ (*start)[1] == 'R') {
+ gly = ESCAPE_FONTCW;
+ break;
+ }
/*
- * Treat constant-width font modes
+ * Treat other constant-width font modes
* just like regular font modes.
*/
(*start)++;