summaryrefslogtreecommitdiff
path: root/appl/cmd/man2html.b
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2008-10-28 08:40:49 +0000
committerCharles.Forsyth <devnull@localhost>2008-10-28 08:40:49 +0000
commit79aa5773891c1a18b316eb6c47f306d496786f80 (patch)
treee877ea53b53114eafa5074bb6be372b781e3bdcc /appl/cmd/man2html.b
parentf93640508dcc7f99bb134dd0054f3f6f548da437 (diff)
20081028-0840
Diffstat (limited to 'appl/cmd/man2html.b')
-rw-r--r--appl/cmd/man2html.b35
1 files changed, 27 insertions, 8 deletions
diff --git a/appl/cmd/man2html.b b/appl/cmd/man2html.b
index 116fb590..21f83284 100644
--- a/appl/cmd/man2html.b
+++ b/appl/cmd/man2html.b
@@ -412,16 +412,14 @@ domanpage(g: ref Global, man: Hit)
dogoobie(g: ref Global, deferred: int)
{
# read line, translate special chars
- line: string;
- while ((token := getnext(g)) != "\n") {
- if (token == nil)
- return;
- line += token;
- }
+ line := getline(g);
+ if (line == nil || line == "\n")
+ return;
# parse into arguments
+ token: string;
argl, rargl: list of string; # create reversed version, then invert
- while ((line = str->drop(line, " \t")) != nil)
+ while ((line = str->drop(line, " \t\n")) != nil)
if (line[0] == '"') {
(token, line) = split(line[1:], '"');
rargl = token :: rargl;
@@ -488,6 +486,13 @@ subgoobie(g: ref Global, argl: list of string)
"1C" or "2C" or "DT" or "TF" => # ignore these
return;
+ "ig" =>
+ while ((line := getline(g)) != nil){
+ if(len line > 1 && line[0:2] == "..")
+ break;
+ }
+ return;
+
"P" or "PP" or "LP" =>
g_PP(g);
@@ -1085,6 +1090,20 @@ Global.softp(g: self ref Global): string
}
#
+# get (remainder of) a line
+#
+getline(g: ref Global): string
+{
+ line := "";
+ while ((token := getnext(g)) != "\n") {
+ if (token == nil)
+ return line;
+ line += token;
+ }
+ return line+"\n";
+}
+
+#
# Get next logical character. Expand it with escapes.
#
getnext(g: ref Global): string
@@ -1185,7 +1204,7 @@ getnext(g: ref Global): string
# if (g.curfont != nil)
# token += sprint("<%s>", g.curfont);
if (token == nil)
- return " "; # shouldn't happen - maybe a \fR inside a font macro - just do something!
+ return "<i></i>"; # looks odd but it avoids inserting a space in <pre> text
return token;
's' =>
sign := '+';