diff options
-rw-r--r-- | man2html/man2html.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/man2html/man2html.c b/man2html/man2html.c index 6c8799d..d190fd1 100644 --- a/man2html/man2html.c +++ b/man2html/man2html.c @@ -48,6 +48,7 @@ int still_dd=0; int tabstops[20] = { 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96 }; int maxtstop=12; int curpos=0; +int recdepth=0; /* request recursion depth */ static char *scan_troff(char *c, int san, char **result); static char *scan_troff_raw(char *c, int san, char **result); @@ -1659,6 +1660,8 @@ scan_request(char *c) { if (c[0] == '\n') return c+1; + recdepth++; + j = strcspn(c, " \n\t"); j += strspn(c + j, " \t"); @@ -3008,6 +3011,9 @@ scan_request(char *c) { if (fillout) { out_html(NEWLINE); curpos++; } NEWLINE[0]='\n'; } + + --recdepth; + return c; } @@ -3051,9 +3057,12 @@ do_scan_troff(char *c, int san, int htmlesc, char **result) { /* san : stop at n FLUSHIBP; h = scan_escape(h); outbuffer[obp] = 0; - if (*h == '\n' && - ((obp > 0 && !isspace(outbuffer[obp-1])) || !fillout)) - escnl = 1; + if (*h == '\n') { + if (recdepth == 0 && ((obp > 0 && !isspace(outbuffer[obp-1])))) + escnl = 1; + else if (!fillout) + escnl = 1; + } } else if (*h == '\b') { intbuff[ibp++]=*h++; if (ibp>480) { FLUSHIBP; } |