|
a/Allura/allura/lib/helpers.py |
|
b/Allura/allura/lib/helpers.py |
|
... |
|
... |
954 |
text = re_amp.sub('&', text)
|
954 |
text = re_amp.sub('&', text)
|
955 |
# avoid accidental 4-space indentations creating code blocks
|
955 |
# avoid accidental 4-space indentations creating code blocks
|
956 |
if preserve_multiple_spaces:
|
956 |
if preserve_multiple_spaces:
|
957 |
text = text.replace('\t', ' ' * 4)
|
957 |
text = text.replace('\t', ' ' * 4)
|
958 |
text = re_preserve_spaces.sub(' ', text)
|
958 |
text = re_preserve_spaces.sub(' ', text)
|
|
|
959 |
else:
|
|
|
960 |
text = re_leading_spaces.sub('', text)
|
|
|
961 |
try:
|
959 |
# try to use html2text for most of the escaping
|
962 |
# try to use html2text for most of the escaping
|
960 |
import html2text
|
963 |
import html2text
|
961 |
html2text.BODY_WIDTH = 0
|
964 |
html2text.BODY_WIDTH = 0
|
962 |
text = html2text.escape_md_section(text, snob=True)
|
965 |
text = html2text.escape_md_section(text, snob=True)
|
963 |
except ImportError:
|
966 |
except ImportError:
|