mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Run smarty pants on Textile for quotes.
This commit is contained in:
parent
1be9804d51
commit
3ef9e4c9b2
@ -64,6 +64,8 @@ import re
|
||||
import uuid
|
||||
from urlparse import urlparse
|
||||
|
||||
from calibre.utils.smartypants import smartyPants
|
||||
|
||||
def _normalize_newlines(string):
|
||||
out = re.sub(r'\r\n', '\n', string)
|
||||
out = re.sub(r'\n{3,}', '\n\n', out)
|
||||
@ -262,10 +264,9 @@ class Textile(object):
|
||||
self.rel = ' rel="%s"' % rel
|
||||
|
||||
text = self.getRefs(text)
|
||||
|
||||
text = self.block(text, int(head_offset))
|
||||
|
||||
text = self.retrieve(text)
|
||||
text = smartyPants(text, 'q')
|
||||
|
||||
return text
|
||||
|
||||
|
@ -165,7 +165,6 @@ class TXTInput(InputFormatPlugin):
|
||||
elif options.formatting_type == 'textile':
|
||||
log.debug('Running text through textile conversion...')
|
||||
html = convert_textile(txt)
|
||||
#setattr(options, 'smarten_punctuation', True)
|
||||
else:
|
||||
log.debug('Running text through basic conversion...')
|
||||
flow_size = getattr(options, 'flow_size', 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user