From: Andres Mejia Date: Sat, 4 Feb 2012 02:13:01 +0000 (-0500) Subject: Fix spacing for all lines printed out. X-Git-Tag: v3.0.4~2^2~125^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2de495ab495e45a3316284cb0984c30a2744232;p=thirdparty%2Flibarchive.git Fix spacing for all lines printed out. This removes need to print out extra line per macro. --- diff --git a/doc/mdoc2mediawiki.awk b/doc/mdoc2mediawiki.awk index fceb62863..9d5852995 100755 --- a/doc/mdoc2mediawiki.awk +++ b/doc/mdoc2mediawiki.awk @@ -63,7 +63,7 @@ function endline() { addclose(trailer) trailer = "" if(length(out) > 0) { - print out + print out " " out="" } if(displaylines > 0) { @@ -138,7 +138,7 @@ function splitwords(l, dest, n, o, w) { } ! /^\./ { - out = $0 " " + out = $0 endline() next } @@ -231,7 +231,7 @@ function splitwords(l, dest, n, o, w) { section=wtail() linecmd("== " section " ==") } else if(match(words[w],"^Xr$")) { - add("'''" words[++w] "'''(" words[++w] ")" words[++w] " ") + add("'''" words[++w] "'''(" words[++w] ")" words[++w]) } else if(match(words[w],"^Nm$")) { if(match(section,"SYNOPSIS")) breakline() @@ -258,20 +258,18 @@ function splitwords(l, dest, n, o, w) { addopen("-") } else if(match(words[w],"^Ar$")) { if(w==nwords) - add("''file ...''" " ") + add("''file ...''") else { ++w gsub("<", "<", words[w]) - add("''" words[w] "''" " ") + add("''" words[w] "''") } } else if(match(words[w],"^Cm$")) { ++w if (displaylines == 0) { - add("'''" words[w] "'''" " ") + add("'''" words[w] "'''") } else add(words[w]) - l = wtail() - add(l " ") } else if(match(words[w],"^Op$")) { addopen("[") option=1 @@ -342,8 +340,6 @@ function splitwords(l, dest, n, o, w) { add(words[w]) } else if(match(words[w],"^Dv$")) { linecmd() - l = wtail() - add(l " ") } else if(match(words[w],"^Em|Ev$")) { add(".IR") } else if(match(words[w],"^Pq$")) {