Typography for markdown files
This commit is contained in:
parent
0ef7a576e4
commit
a6eb3e0c2c
@ -73,8 +73,17 @@ def gfm(text):
|
|||||||
text = re.sub(r'{gfm-extraction-([0-9a-f]{32})\}', pre_insert_callback,
|
text = re.sub(r'{gfm-extraction-([0-9a-f]{32})\}', pre_insert_callback,
|
||||||
text)
|
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 text
|
||||||
|
|
||||||
|
return handle_typography(text)
|
||||||
|
|
||||||
|
|
||||||
# Test suite.
|
# Test suite.
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user