aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit1ee1eeda195d12cccd87b8fdfca9e982035a89e7 (patch)
treedc8c759f44513405842fdbdf491a24a9926a28b9 /html.c
parent6fcb5ea18d95e1cc79dd37b4e2860f4e8c898346 (diff)
downloadmandoc-1ee1eeda195d12cccd87b8fdfca9e982035a89e7.tar.gz
mandoc-1ee1eeda195d12cccd87b8fdfca9e982035a89e7.tar.zst
mandoc-1ee1eeda195d12cccd87b8fdfca9e982035a89e7.zip
Flip on unicode output (via \[uNNNN]) in -T[x]html. Here we go!
Diffstat (limited to 'html.c')
-rw-r--r--html.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/html.c b/html.c
index a50d2eb0..fd696284 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.143 2011/05/17 11:38:18 kristaps Exp $ */
+/* $Id: html.c,v 1.144 2011/05/17 11:50:20 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -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)