From 7a730be185fb32ba3680e3824804ec8b02414f8c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 11 May 2013 16:20:51 +0200 Subject: [PATCH] Tighten up emp2html's info reference recognition 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/info/emp2html.pl b/info/emp2html.pl index 0cd13424..7b7d82e7 100644 --- a/info/emp2html.pl +++ b/info/emp2html.pl @@ -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//g;