imporved hyphenation to build.py
This commit is contained in:
+5
-3
@@ -243,10 +243,12 @@ def hyphenate(node):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# add none breaking spaces
|
# add none breaking spaces
|
||||||
nbspzr = ['"', '»', '«', '\.', '\!', '\?', ':', ';']
|
nbspzr_before = ['"', '»', '\!', '\?', ':', ';']
|
||||||
for char in nbspzr:
|
for char in nbspzr_before:
|
||||||
# print(char)
|
|
||||||
nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr)
|
nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr)
|
||||||
|
|
||||||
|
nbspzr_after = ['"', '«']
|
||||||
|
for char in nbspzr_after:
|
||||||
nodestr = re.sub(r'(\w)\s('+char+')', r'\1 \2', nodestr)
|
nodestr = re.sub(r'(\w)\s('+char+')', r'\1 \2', nodestr)
|
||||||
|
|
||||||
# print(nodestr)
|
# print(nodestr)
|
||||||
|
|||||||
Reference in New Issue
Block a user