From 8d169ca5abedab30931b2e8a6d70811a60787b41 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Mon, 19 Jun 2017 19:33:56 +0200 Subject: [PATCH] imporved hyphenation to build.py --- bin/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/build.py b/bin/build.py index c5a7853..1e620cd 100755 --- a/bin/build.py +++ b/bin/build.py @@ -245,11 +245,11 @@ def hyphenate(node): # add none breaking spaces nbspzr_before = ['»', '\!', '\?', ':', ';'] for char in nbspzr_before: - nodestr = re.sub(r'('+char+')\s(\w)', 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'(\w)\s('+char+')', r'\1 \2', nodestr) + nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr) # print(nodestr) # replace node by hyphenated one