TXT Output: Textile don't blindly remove %'s, modify html2textile to not write % from spans.

This commit is contained in:
John Schember 2011-02-08 07:03:28 -05:00
parent b814809d9f
commit dbc133be13
2 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,6 @@ class TextileMLizer(object):
html = re.sub(r'<\s*img[^>]*>', '', html) html = re.sub(r'<\s*img[^>]*>', '', html)
text = html2textile(html) text = html2textile(html)
text = text.replace('%', '')
# Ensure the section ends with at least two new line characters. # Ensure the section ends with at least two new line characters.
# This is to prevent the last paragraph from a section being # This is to prevent the last paragraph from a section being

View File

@ -77,7 +77,7 @@ class EchoTarget:
new_tag = '~' new_tag = '~'
newline = '' newline = ''
elif tag == 'span': elif tag == 'span':
new_tag = '%' new_tag = ''
newline = '' newline = ''
elif tag == 'a': elif tag == 'a':
self.block = True self.block = True
@ -147,7 +147,7 @@ class EchoTarget:
elif tag == 'sub': elif tag == 'sub':
self.final_output.append('~') self.final_output.append('~')
elif tag == 'span': elif tag == 'span':
self.final_output.append('%') self.final_output.append('')
elif tag == 'a': elif tag == 'a':
if self.a_part['title']: if self.a_part['title']:
textilized = ' "%s (%s)":%s ' % ( textilized = ' "%s (%s)":%s ' % (