Typography for markdown files
This commit is contained in:
parent
0ef7a576e4
commit
a6eb3e0c2c
@ -73,7 +73,16 @@ def gfm(text):
|
||||
text = re.sub(r'{gfm-extraction-([0-9a-f]{32})\}', pre_insert_callback,
|
||||
text)
|
||||
|
||||
return text
|
||||
def handle_typography(text):
|
||||
""" Add non breakable spaces before double punctuation signs."""
|
||||
text = text.replace(' :', ' :')
|
||||
text = text.replace(' ;', ' ;')
|
||||
text = text.replace(' !', ' !')
|
||||
text = text.replace(' ?', ' ?')
|
||||
text = text.replace(' /', ' /')
|
||||
return text
|
||||
|
||||
return handle_typography(text)
|
||||
|
||||
|
||||
# Test suite.
|
||||
|
Loading…
Reference in New Issue
Block a user