imporved hyphenation to build.py

This commit is contained in:
Bachir Soussi Chiadmi
2017-06-19 19:37:43 +02:00
parent 8d169ca5ab
commit 7d5c19f9fd
+2 -2
View File
@@ -245,11 +245,11 @@ def hyphenate(node):
# add none breaking spaces
nbspzr_before = ['»', '\!', '\?', ':', ';']
for char in nbspzr_before:
nodestr = re.sub(r'(\w)\s('+char+')', r'\1 \2', nodestr)
nodestr = re.sub(r'(\w|>)\s('+char+')', r'\1 \2', nodestr)
nbspzr_after = ['«']
for char in nbspzr_after:
nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr)
nodestr = re.sub(r'('+char+')\s(\w|<)', r'\1&nbsp;\2', nodestr)
# print(nodestr)
# replace node by hyphenated one