aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-14 15:56:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-14 15:56:37 +0000
commitff3d7d9996ea5f017430919b824c15e1bf1a6e31 (patch)
tree5492b63432e1ca32fc00f6eb2dab95b01213512a /html.c
parentc5573921b272ce5903b1846fecd6a58e1cb0e6c9 (diff)
downloadmandoc-ff3d7d9996ea5f017430919b824c15e1bf1a6e31.tar.gz
mandoc-ff3d7d9996ea5f017430919b824c15e1bf1a6e31.tar.zst
mandoc-ff3d7d9996ea5f017430919b824c15e1bf1a6e31.zip
print HTML character references as 4+ digits hexadecimal, like Unicode;
from bentley@, tweaked by me
Diffstat (limited to 'html.c')
-rw-r--r--html.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/html.c b/html.c
index cb7ffeae..1cc615cc 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.215 2017/06/23 02:32:12 schwarze Exp $ */
+/* $Id: html.c,v 1.216 2017/07/14 15:56:37 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -453,7 +453,7 @@ print_encode(struct html *h, const char *p, const char *pend, int norecurse)
(c > 0x7E && c < 0xA0))
c = 0xFFFD;
if (c > 0x7E) {
- (void)snprintf(numbuf, sizeof(numbuf), "&#%d;", c);
+ (void)snprintf(numbuf, sizeof(numbuf), "&#x%.4X;", c);
print_word(h, numbuf);
} else if (print_escape(h, c) == 0)
print_byte(h, c);
@@ -516,7 +516,7 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...)
print_indent(h);
else if ((h->flags & HTML_NOSPACE) == 0) {
if (h->flags & HTML_KEEP)
- print_word(h, "&#160;");
+ print_word(h, "&#x00A0;");
else {
if (h->flags & HTML_PREKEEP)
h->flags |= HTML_KEEP;
@@ -779,7 +779,7 @@ print_text(struct html *h, const char *word)
h->flags |= HTML_KEEP;
print_endword(h);
} else
- print_word(h, "&#160;");
+ print_word(h, "&#x00A0;");
}
assert(NULL == h->metaf);