summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-17 11:50:20 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-17 11:50:20 +0000
commitc301d6bfc6c1471a4225e7e6e993b6e160f76c1b (patch)
tree0aa4dd6700e45eb7dc861fe73bf61649fc3eee5c /html.c
parent8cd2f76125361d3c04dd2730e7748c925a33d2a2 (diff)
downloadmandoc-c301d6bfc6c1471a4225e7e6e993b6e160f76c1b.tar.gz
Flip on unicode output (via \[uNNNN]) in -T[x]html. Here we go!
Diffstat (limited to 'html.c')
-rw-r--r--html.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/html.c b/html.c
index 6313e4c3..543caea3 100644
--- a/html.c
+++ b/html.c
@@ -315,6 +315,8 @@ html_strlen(const char *cp)
switch (mandoc_escape(&cp, &seq, &ssz)) {
case (ESCAPE_ERROR):
return(sz);
+ case (ESCAPE_UNICODE):
+ /* FALLTHROUGH */
case (ESCAPE_NUMBERED):
/* FALLTHROUGH */
case (ESCAPE_PREDEF):
@@ -373,6 +375,12 @@ print_encode(struct html *h, const char *p, int norecurse)
break;
switch (esc) {
+ case (ESCAPE_UNICODE):
+ /* Skip passed "u" header. */
+ c = mchars_num2uc(seq + 1, len - 1);
+ if ('\0' != c)
+ printf("&#x%x;", c);
+ break;
case (ESCAPE_NUMBERED):
c = mchars_num2char(seq, len);
if ('\0' != c)