summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-14 16:28:23 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-14 16:28:23 +0000
commite3ef897e17cf74a686ec213e362a869d4a9b77f0 (patch)
tree7e083906c57c2483457de701867f60b8ecbbcfa5 /mdoc_html.c
parentbc80934db614d28c7b53a0b013dd68c4e6234c7e (diff)
downloadmandoc-e3ef897e17cf74a686ec213e362a869d4a9b77f0.tar.gz
mandoc-e3ef897e17cf74a686ec213e362a869d4a9b77f0.tar.zst
mandoc-e3ef897e17cf74a686ec213e362a869d4a9b77f0.zip
Give -Thtml and -Txhtml the gift of recognising escapes when calculating
widths (e.g., `Bl -tag -width "\s[blahblah]bar"). This has long since been done for -Tascii but escaped noticed with -T[x]html.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 652e8536..73cf1182 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.165 2011/04/23 09:10:50 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.166 2011/05/14 16:28:23 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -288,7 +288,7 @@ a2width(const char *p, struct roffsu *su)
if ( ! a2roffsu(p, su, SCALE_MAX)) {
su->unit = SCALE_BU;
- su->scale = (int)strlen(p);
+ su->scale = html_strlen(p);
}
}
@@ -355,7 +355,7 @@ a2offs(const char *p, struct roffsu *su)
SCALE_HS_INIT(su, INDENT * 2);
else if ( ! a2roffsu(p, su, SCALE_MAX)) {
su->unit = SCALE_BU;
- su->scale = (int)strlen(p);
+ su->scale = html_strlen(p);
}
}
@@ -703,7 +703,7 @@ mdoc_nm_pre(MDOC_ARGS)
{
struct htmlpair tag;
struct roffsu su;
- size_t len;
+ int len;
switch (n->type) {
case (MDOC_ELEM):
@@ -731,10 +731,10 @@ mdoc_nm_pre(MDOC_ARGS)
for (len = 0, n = n->child; n; n = n->next)
if (MDOC_TEXT == n->type)
- len += strlen(n->string);
+ len += html_strlen(n->string);
if (0 == len && m->name)
- len = strlen(m->name);
+ len = html_strlen(m->name);
SCALE_HS_INIT(&su, (double)len);
bufcat_su(h, "width", &su);