summaryrefslogtreecommitdiffstats
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
commit8953dce6410913db1ce531b8f37750ee72bc45e7 (patch)
treeadc1699cfeb140a4e6efb7ef95be6681941ea2fe /html.c
parent25b9ffe82ac5592b33241ae447d947f4dca24f7f (diff)
downloadmandoc-8953dce6410913db1ce531b8f37750ee72bc45e7.tar.gz
Give -T[x]html `Bk -words' capability.
Diffstat (limited to 'html.c')
-rw-r--r--html.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/html.c b/html.c
index f92c37a2..b3443251 100644
--- a/html.c
+++ b/html.c
@@ -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))