From 567f6e3a30748207fba894bbec9e83c359ba1526 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Mon, 19 Jun 2017 19:24:24 +0200 Subject: [PATCH] imporved hyphenation to build.py --- bin/build.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/build.py b/bin/build.py index c66a48e..4e3748e 100755 --- a/bin/build.py +++ b/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)