case sensitive match of link can "break" links working in original chm file
12 views
Skip to first unread message
Reto
unread,
Nov 12, 2011, 11:57:02 AM11/12/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to chm2pdf
Ciao!
In my application some links are not working in the PDF as I have some
upper/lower case errors in links.
As CHM is "windows stuff" this doesen't matter there, but "here" it
does!
So how about making the 1. pass matching case insensitive adding the (?
i) modifier in the regular expression?
I tried this and it seems to work!
# Substitutions in 1st pass: we replace the original
filenames with their corresponding "garbled" equivalents.
# added (?i) modifier to make a case insensitive match for
not breaking working
# links on windows in CHM files ....
for match_string in match_strings:
replace_string =
replace_garbled_strings[match_strings.index(match_string)]
page = re.sub('(?i)'+match_string, replace_string,
page)