--- chm2pdf 2011-11-20 17:46:26.000000000 +0100 +++ chm2pdf_links_case_insensitive 2011-11-20 19:40:07.000000000 +0100 @@ -460,9 +460,11 @@ pf.close() # 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 + # added " to the match criteria to avoid wrong match (eg this.htm matched also do_this.htm before) for match_string in match_strings: - replace_string = replace_garbled_strings[match_strings.index(match_string)] - page = re.sub(match_string, replace_string, page) + replace_string = replace_garbled_strings[match_trings.index(match_string)] + page = re.sub('(?i)"'+match_string, '"'+replace_string, page) # Substitutuions in the 2nd pass: we replace the garbled filenames with the correct ones.