diff options
Diffstat (limited to 'templates/html/bib2xhtml.pl')
-rwxr-xr-x | templates/html/bib2xhtml.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/templates/html/bib2xhtml.pl b/templates/html/bib2xhtml.pl index da6dc62..539aaab 100755 --- a/templates/html/bib2xhtml.pl +++ b/templates/html/bib2xhtml.pl @@ -118,11 +118,14 @@ sub html_ent { s/\\lfloor\b/⌊/g; s/\\rfloor\b/⌋/g; } +$bdebug = 0; foreach (@ARGV) { if (/\.bib$/) { $bibfile = $_; $bibfile =~ s/\.bib$//; push(@bibfiles,$bibfile); + } elsif ("$_" eq "-d") { + $bdebug = 1; } else { $htmlfile = $_; } @@ -198,7 +201,7 @@ while (<BBLFILE>) { next loop; } $nentry++; - ($bcite, $blabel) = m+<dt><a name=\"([^\"]*)\">\[([^\]]*)\]</a></dt><dd>+; + ($bcite, $blabel) = m:<dt><a\s+name=\"([^\"]*)\">\[([^\]]*)\]</a></dt><dd>:; $blabel = "$nentry"; $bibcite{$bcite} = $blabel; } @@ -222,7 +225,7 @@ while (<BBLFILE>) { } s/\%\n//g; s/(\.(<\/cite>|<\/a>|\')+)\./$1/g; - s:(<dt><a name=\"[^\"]*\">\[)[^\]]*(\]</a></dt><dd>):$1$nentry$2:; + s:(<dt><a\s+name=\"[^\"]*\">\[)[^\]]*(\]</a></dt><dd>):$1$nentry$2:; while (m/(\\(cite(label)?)(\001\d+)\{([^\001]+)\4\})/) { $old = $1; $cmd = $2; @@ -315,5 +318,7 @@ close (OHTMLFILE); close(HTMLFILE); chmod($mode, "$htmlfile$$"); rename("$htmlfile$$", $htmlfile); -unlink(@tmpfiles); +if ($bdebug == 0) { + unlink(@tmpfiles); +} exit(0); |