Browse Source

imporved hyphenation to build.py

Bachir Soussi Chiadmi 6 years ago
parent
commit
567f6e3a30
1 changed files with 5 additions and 3 deletions
  1. 5 3
      bin/build.py

+ 5 - 3
bin/build.py

@@ -243,10 +243,12 @@ def hyphenate(node):
          pass
 
    # add none breaking spaces
-   nbspzr = ['"', '»', '«', '\.', '\!', '\?', ':', ';']
-   for char in nbspzr:
-      # print(char)
+   nbspzr_before = ['"', '»', '\!', '\?', ':', ';']
+   for char in nbspzr_before:
       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)
 
    # print(nodestr)