=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.191 retrieving revision 1.192 diff -u -p -r1.191 -r1.192 --- mandoc/mdoc_html.c 2014/07/02 03:48:07 1.191 +++ mandoc/mdoc_html.c 2014/07/02 19:55:10 1.192 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.191 2014/07/02 03:48:07 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.192 2014/07/02 19:55:10 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -1524,22 +1524,15 @@ static int mdoc_sm_pre(MDOC_ARGS) { - assert(n->child && MDOC_TEXT == n->child->type); - if (0 == strcmp("on", n->child->string)) { - /* - * FIXME: no p->col to check. Thus, if we have - * .Bd -literal - * .Sm off - * 1 2 - * .Sm on - * 3 - * .Ed - * the "3" is preceded by a space. - */ - h->flags &= ~HTML_NOSPACE; + if (NULL == n->child) + h->flags ^= HTML_NONOSPACE; + else if (0 == strcmp("on", n->child->string)) h->flags &= ~HTML_NONOSPACE; - } else + else h->flags |= HTML_NONOSPACE; + + if ( ! (HTML_NONOSPACE & h->flags)) + h->flags &= ~HTML_NOSPACE; return(0); }