aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
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))