]> git.pond.sub.org Git - empserver/commitdiff
Tighten up emp2html's info reference recognition
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 11 May 2013 14:20:51 +0000 (16:20 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 May 2013 16:52:58 +0000 (18:52 +0200)
Combine the two loops looking for \*QNAME\*U and "info NAME" into one.
Recognize "info NAME" only with the closing '"' to be present.

No change with current info sources.

info/emp2html.pl

index 0cd134246a2bd6732c7b97660015984b1a296de6..7b7d82e787acb257996eee0f0efc04af20e5d676 100644 (file)
@@ -182,11 +182,12 @@ sub htmlify {
     s/\\e/&\#92;/g;            # escape character
     # turn quoted strings that look like info names into links
     # tacky...
-    while (/(\\\*Q)([A-Za-z0-9\-\.]+)(\\\*U)/) {
-       $_ = $` . anchor($2) . "$'";
-    }
-    while (/(\"info )([A-Za-z0-9\-\.]+)/) {
-       $_ = "$`\"info " . anchor($2) . "$'";
+    while (/\\\*Q([A-Za-z0-9\-\.]+)\\\*U|\"info ([A-Za-z0-9\-\.]+)\"/) {
+       if (defined $1) {
+           $_ = $` . anchor($1) . "$'";
+       } else {
+           $_ = "$`\"info " . anchor($2) . "\"$'";
+       }
     }
     # tranlate more troff escapes and strings
     s/\\\*Q/<em>/g;