diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-06 12:37:17 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-06 12:37:17 +0000 |
commit | b5257bc3473c0f02c94b7717debac9dc6b0738f4 (patch) | |
tree | dea841229e4f16df1ee64d746bb20d0f7759469c /html.c | |
parent | ed642de7ca282d168ea118d0860186abb1abcd59 (diff) | |
download | mandoc-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.c | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -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(" "); + } /* 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(" "); + } assert(word); if ( ! print_encode(h, word, 0)) |