=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.104 retrieving revision 1.106 diff -u -p -r1.104 -r1.106 --- mandoc/html.c 2010/07/06 11:10:53 1.104 +++ mandoc/html.c 2010/07/13 23:53:20 1.106 @@ -1,6 +1,6 @@ -/* $Id: html.c,v 1.104 2010/07/06 11:10:53 kristaps Exp $ */ +/* $Id: html.c,v 1.106 2010/07/13 23:53:20 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -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))