table background color removed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
chm2pdf |
Unknown
|
Unknown
|
|||
chm2pdf (Ubuntu) |
Confirmed
|
High
|
Unassigned |
Bug Description
The first bgcolor="#001122" afre a link will become bgcolor="", due to this regex which is too greedy:
# Replace links of the form "somefile.html#894" with "somefile0206.html"
# The following will match anchors like '<a href="temp0206.
# The replace string will then replace it with '<a href="temp0206.
# This is because the numbers after the '#' are often wrong or non-existent. It is better to link to an existing
# chapter than to a non-existent part of an existing chapter.
page = re.sub('(?i)<a href="(
because it matches everything until the next #, even if it is outside the link!
How about this? Is this the way to go? .. at least it seems to work!
page = re.sub('(?i)<a href="(
I modified the same place even more, because in my file I have links like <a href="#X1">X1</a> and so nothing of the link would be left: in my optinion, in this case I prefer to leave the link intact, as it points inside the same file!
page = re.sub('(?i)<a href="(
Related branches
Changed in chm2pdf (Ubuntu): | |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
importance: | Undecided → High |
summary: |
- table background color removed Options + table background color removed |
This is the first time I try to generate a patch... hope this is correct!
Changed one regular expression:
- added (?i) to make regex case insensitive
- search for #links stops at # and "
- * changed to + to ignore internal links "#..."