summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-11-14 11:58:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-11-14 11:58:36 +0000
commitb7321ad35a6dbbfd5b61781b7cd128a4ad6e4cae (patch)
treeac1dc58d9a79b5964eecbc89a4ca2cdc0f1d8943
parentc55c7c742e50a932784d8cd8689f4ad216fcc91f (diff)
downloadmandoc-b7321ad35a6dbbfd5b61781b7cd128a4ad6e4cae.tar.gz
mandoc-b7321ad35a6dbbfd5b61781b7cd128a4ad6e4cae.tar.zst
mandoc-b7321ad35a6dbbfd5b61781b7cd128a4ad6e4cae.zip
Fixed \c handling in -Thtml.
-rw-r--r--html.c16
-rw-r--r--html.h7
-rw-r--r--man_html.c7
3 files changed, 14 insertions, 16 deletions
diff --git a/html.c b/html.c
index f1a256f1..f749ed44 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.84 2009/11/12 08:21:05 kristaps Exp $ */
+/* $Id: html.c,v 1.85 2009/11/14 11:58:36 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -91,7 +91,7 @@ extern int getsubopt(char **, char * const *, char **);
static void print_spec(struct html *, const char *, size_t);
static void print_res(struct html *, const char *, size_t);
static void print_ctag(struct html *, enum htmltag);
-static void print_encode(struct html *, const char *);
+static int print_encode(struct html *, const char *);
void *
@@ -220,14 +220,16 @@ print_res(struct html *h, const char *p, size_t len)
}
-static void
+static int
print_encode(struct html *h, const char *p)
{
size_t sz;
- int len;
+ int len, nospace;
const char *seq;
enum roffdeco deco;
+ nospace = 0;
+
for (; *p; p++) {
sz = strcspn(p, "\\<>&");
@@ -264,8 +266,10 @@ print_encode(struct html *h, const char *p)
p += len - 1;
if (DECO_NOSPACE == deco && '\0' == *(p + 1))
- h->flags |= HTML_NOSPACE;
+ nospace = 1;
}
+
+ return(nospace);
}
@@ -296,7 +300,7 @@ print_otag(struct html *h, enum htmltag tag,
for (i = 0; i < sz; i++) {
printf(" %s=\"", htmlattrs[p[i].key]);
assert(p->val);
- print_encode(h, p[i].val);
+ (void)print_encode(h, p[i].val);
putchar('\"');
}
putchar('>');
diff --git a/html.h b/html.h
index 19550da1..c4fc793d 100644
--- a/html.h
+++ b/html.h
@@ -1,4 +1,4 @@
-/* $Id: html.h,v 1.18 2009/11/10 16:20:22 kristaps Exp $ */
+/* $Id: html.h,v 1.19 2009/11/14 11:58:36 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -112,10 +112,7 @@ struct html {
char *style;
char buf[BUFSIZ];
size_t buflen;
- int metafont;
-#define METAF_BOLD (1 << 0)
-#define METAF_UNDER (1 << 1)
- int metamask;
+ struct tag *metaf;
};
struct roffsu;
diff --git a/man_html.c b/man_html.c
index 81b78ee4..df0527e3 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.18 2009/11/10 12:03:30 kristaps Exp $ */
+/* $Id: man_html.c,v 1.19 2009/11/14 11:58:36 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -188,7 +188,7 @@ print_man_node(MAN_ARGS)
break;
case (MAN_TEXT):
print_text(h, n->string);
- break;
+ return;
default:
if (mans[n->tok].pre)
child = (*mans[n->tok].pre)(m, n, h);
@@ -211,9 +211,6 @@ print_man_node(MAN_ARGS)
default:
if (mans[n->tok].post)
(*mans[n->tok].post)(m, n, h);
-
- /* Reset metafont upon exit from macro. */
- h->metafont = 0;
break;
}
}