summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-21 20:33:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-21 20:33:25 +0000
commit1f42b16d7620434847b937d82a463bd7cbe63255 (patch)
tree4ee3ab1a6a2c6f5ee76f69a33d0b12a1aae40bf8 /html.c
parent28c98469ed60b736b7c70dc094a9d94197a1568f (diff)
downloadmandoc-1f42b16d7620434847b937d82a463bd7cbe63255.tar.gz
Rudimentary implementation of the roff(7) \o escape sequence (overstrike).
This is of some relevance because the pod2man(1) preamble abuses it for the icelandic letter Thorn, instead of simply using \(TP and \(Tp. Missing feature found by sthen@ in DateTime::Locale::is_IS(3p).
Diffstat (limited to 'html.c')
-rw-r--r--html.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/html.c b/html.c
index 0560d14e..c72c3d48 100644
--- a/html.c
+++ b/html.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -307,6 +307,8 @@ html_strlen(const char *cp)
case ESCAPE_NUMBERED:
/* FALLTHROUGH */
case ESCAPE_SPECIAL:
+ /* FALLTHROUGH */
+ case ESCAPE_OVERSTRIKE:
if (skip)
skip = 0;
else
@@ -433,6 +435,11 @@ print_encode(struct html *h, const char *p, int norecurse)
if ('\0' == *p)
nospace = 1;
continue;
+ case ESCAPE_OVERSTRIKE:
+ if (len == 0)
+ continue;
+ c = seq[len - 1];
+ break;
default:
continue;
}