Allow to emit words with leading punctuation character (as defined in closingpunct()). If the punctuation character is the first element of the Itexttag item, a space is not inserted. Reference: /n/sources/patch/applied/htmlfmt-missing-spaces Date: Tue Jan 22 12:26:31 CET 2013 Signed-off-by: yngoto@gmail.com --- /sys/src/cmd/htmlfmt/html.c Tue Jan 22 12:26:10 2013 +++ /sys/src/cmd/htmlfmt/html.c Tue Jan 22 12:26:07 2013 @@ -12,6 +12,7 @@ "://([a-zA-Z0-9_@\\-]+([.:][a-zA-Z0-9_@\\-]+)*)"; Reprog *urlprog; +int newitextitem; int inword = 0; int col = 0; int wordi = 0; @@ -68,7 +69,7 @@ if(nr == 0) return; s = smprint("%.*S", nr, r); - space = b->n > 0 && !isspace(b->b[b->n-1]) && !closingpunct(*s); + space = b->n > 0 && !isspace(b->b[b->n-1]) && (!newitextitem || !closingpunct(*s)); if(col > 0 && col+space+nr > width){ growbytes(b, "\n", 1); space = 0; @@ -82,6 +83,7 @@ col += nr; free(s); inword = 0; + newitextitem = 0; } void @@ -89,6 +91,8 @@ { int i, n; + newitextitem = 1; + n = runestrlen(r); for(i=0; istate & IFwrap) renderrunes(t, it->s); - else + else { + newitextitem = 1; emitword(t, it->s, runestrlen(it->s)); + } break; case Iruletag: if(t->n>0 && t->b[t->n-1]!='\n')