mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-03 02:14:31 +02:00
Run smarty pants on Textile for quotes.
This commit is contained in:
parent
1be9804d51
commit
3ef9e4c9b2
2 changed files with 3 additions and 3 deletions
|
|
@ -64,6 +64,8 @@
|
|||
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 @@ def textile(self, text, rel=None, head_offset=0, html_type='xhtml'):
|
|||
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 @@ def convert(self, stream, options, file_ext, log,
|
|||
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…
Reference in a new issue