aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-07-06 12:37:17 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-07-06 12:37:17 +0000
commitb5257bc3473c0f02c94b7717debac9dc6b0738f4 (patch)
treedea841229e4f16df1ee64d746bb20d0f7759469c /html.c
parented642de7ca282d168ea118d0860186abb1abcd59 (diff)
downloadmandoc-b5257bc3473c0f02c94b7717debac9dc6b0738f4.tar.gz
mandoc-b5257bc3473c0f02c94b7717debac9dc6b0738f4.tar.zst
mandoc-b5257bc3473c0f02c94b7717debac9dc6b0738f4.zip
Give -T[x]html `Bk -words' capability.
Diffstat (limited to 'html.c')
-rw-r--r--html.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/html.c b/html.c
index f7bfa3c2..15b8b467 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.104 2010/07/06 11:10:53 kristaps Exp $ */
+/* $Id: html.c,v 1.105 2010/07/06 12:37:17 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -393,8 +393,15 @@ print_otag(struct html *h, enum htmltag tag,
t = NULL;
if ( ! (HTML_NOSPACE & h->flags))
- if ( ! (HTML_CLRLINE & htmltags[tag].flags))
- putchar(' ');
+ if ( ! (HTML_CLRLINE & htmltags[tag].flags)) {
+ /* Manage keeps! */
+ if ( ! (HTML_KEEP & h->flags)) {
+ if (HTML_PREKEEP & h->flags)
+ h->flags |= HTML_KEEP;
+ putchar(' ');
+ } else
+ printf("&#160;");
+ }
/* Print out the tag name and attributes. */
@@ -511,8 +518,15 @@ print_text(struct html *h, const char *word)
break;
}
- if ( ! (h->flags & HTML_NOSPACE))
- putchar(' ');
+ if ( ! (HTML_NOSPACE & h->flags)) {
+ /* Manage keeps! */
+ if ( ! (HTML_KEEP & h->flags)) {
+ if (HTML_PREKEEP & h->flags)
+ h->flags |= HTML_KEEP;
+ putchar(' ');
+ } else
+ printf("&#160;");
+ }
assert(word);
if ( ! print_encode(h, word, 0))