Thread: Sigil Plugins!
View Single Post
Old 08-24-2013, 09:58 AM   #25
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Just found another flub, when an n/mdash entity was at beginning or end of line, the entity was being changed, but the count wasn't getting added to (as the extras/offset check wasn't getting a match), so the tags went out of alignment with the text.

Hopefully this should be it. (famous last words...)

Edit:
If you don't want it to do any of the (m/n)dash or ellipsis entities, you can comment out the following lines (add a # to beginning of the line) in the smarten.py file
32, 33, 34, 35, 36 and 56, 57, 58

Edit 2:
Yep, spoke too soon.
Just updated it, missed removing a couple of characters in the ndash replace line.
If you've already downloaded this new version, can you change line 57 in smarten.py to:
Code:
    text = re.sub(r'(?<=[^-])--(?=[^-])', r'–', text, flags=re.M) # ndash
Attached Files
File Type: zip smarten_sigil_plugin.zip (2.4 KB, 269 views)

Last edited by Perkin; 08-24-2013 at 10:58 AM.
Perkin is offline   Reply With Quote