Man. I added this myself, and decided that -- while I was at it -- I should come back here to add your code too (assuming it was a different feature!). That's what I get for reading a bunch of books in my spare time instead of this thread!
I'll post an update in a few days. I also have the code for non-page-breaking Chapters, but it's not plugged in yet. I have to try it out then I'll probably post the update flagged as beta.
Sorry, no image support. I'm not sure I'll ever add that.
-Pie
Quote:
Originally Posted by Lime2K
Here's a bug report, _and_ the fix for it (it was a really easy one)
PieLRF wasn't recognizing ‘ and ’ as single quotes.
Here's the original code <in textconvert.py>, under <def convert_html_ampersands>
Code:
The original code:
if html_quotes :
line = line.replace("“", u"\u201C") # OPEN
line = line.replace("”", u"\u201D") # CLOSE
line = line.replace("“", u"\u201C")
line = line.replace("”", u"\u201D")
line = line.replace("‘", u"\u2018")
line = line.replace("’", u"\u2019")
else :
line = line.replace("“", u"\"")
line = line.replace("”", u"\"")
line = line.replace("“", u"\"")
line = line.replace("”", u"\"")
line = line.replace("‘", u"'")
line = line.replace("’", u"'")
#endif
Replace with:
if html_quotes :
line = line.replace("“", u"\u201C") # OPEN
line = line.replace("”", u"\u201D") # CLOSE
line = line.replace("“", u"\u201C")
line = line.replace("”", u"\u201D")
line = line.replace("‘", u"\u2018")
line = line.replace("’", u"\u2019")
line = line.replace("‘", u"\u2018")
line = line.replace("’", u"\u2019")
else :
line = line.replace("“", u"\"")
line = line.replace("”", u"\"")
line = line.replace("“", u"\"")
line = line.replace("”", u"\"")
line = line.replace("‘", u"'")
line = line.replace("’", u"'")
line = line.replace("‘", u"'")
line = line.replace("’", u"'")
#endif
This keeps the correct behavior of --html-quotes.
I fixed it in my personal copy already, but am posting it here so it makes it into the official releases as well.
Enjoy!
|