Run smarty pants on Textile for quotes.

This commit is contained in:
John Schember 2011-03-26 13:25:02 -04:00
parent 1be9804d51
commit 3ef9e4c9b2
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)