View Single Post
Old 03-09-2012, 07:20 AM   #8
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by DiapDealer View Post
That's all part of what SmartyPants does. quotes, ellipses, em- en-dash conversion.

I wasn't guessing. I looked at the code for the SmartyPants script that's included with calibre. The only things Smarten punctuation converts to the elipse character is three periods in a row, or period<sp>period<sp>period.

Period-nbsp-period-nbsp-period will escape Smarten punctuation's notice.
I wasn't guessing either, though I didn't fully get the gist of your response - I missed your point about non-breaking spaces, which is true regardless (although I think the OP asked about nbsp as a separate topic). Last time I checked though Smartypants didn't change three dots in a row, e.g. '...'. I'll readily admit that it's quite possible I'm no longer correct about current behavior due to more recent changes in smartypants. I know my original statement was true at one time in the past because smarten punctuation didn't affect ellipsis or double dashes, to resolve the issue I added and QA'd the extra logic which modifies them. Check the last lines of code here:
http://bazaar.launchpad.net/~kovid/c.../preprocess.py

edit - it's possible you're agreeing with me, but we got mixed up on where the smartypants vs smarten_punctuation code is.

Last edited by ldolse; 03-09-2012 at 07:26 AM.
ldolse is offline   Reply With Quote