If I have a wiki topic that is named Topic.
I have link in that topic to another topic named TopicExample.
In this case the genPdf _fixhtml code gets too greedy trying to create internal links as opposed to external links back to the wiki website..
In particular, on line 364, there is the line..
$html =~ s/$url(?!#)/#$wikiword/g; # not anchored
In this case, the url is something like
http://wiki/twiki/bin/view/MyWeb/Topic
The link in the file for TopicExample is
http://wiki/twiki/bin/view/MyWeb/TopicExample
This matches the above perl line and the first part (everything except Example) gets replaced by $wikiword (Topic in this case),
So I end up with a link in the pdf that looks like #TopicExample, not an external link I intended.
My solution for this is to look for beginning and end quotes around the $url and only do the replace if there are quotes around the url.
$html =~ s/([\'\"])$url\1/\1#$wikiword\1/g; # not anchored
--
TWiki:Main/KevinKalmbach
- 01 Feb 2007
Another issue that causes breaks is that TWiki (4.0.5) leaves "<nop>" tags in the output HTML. These aren't needed by htmldoc. More to the point, they can break some of the REs used in
GenPDF.pm. This line (in _fixHtml) removes them:
$html =~ s/<nop>//g