From 0717665b69fb372ac075bfd48e8bac068df31242 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 6 Nov 2012 10:40:08 -0500 Subject: [PATCH] zephyr_mirror: Zev's proposed fix to latest linewrapping problem. (imported from commit 90fc4774e10255d0237a37b8af753059a66efb2d) --- api/bots/zephyr_mirror.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/bots/zephyr_mirror.py b/api/bots/zephyr_mirror.py index f521e284e9..7e50192ea6 100755 --- a/api/bots/zephyr_mirror.py +++ b/api/bots/zephyr_mirror.py @@ -58,9 +58,12 @@ def unwrap_lines(body): previous_line = lines[0] for line in lines[1:]: line = line.rstrip() - if (line == "" or + if (re.match(r'^\W', line, flags=re.UNICODE) + and re.match(r'^\W', previous_line, flags=re.UNICODE)): + result += previous_line + "\n" + elif (line == "" or previous_line == "" or - not re.match(r'^[\w]', line, flags=re.UNICODE) or + re.match(r'^\W', line, flags=re.UNICODE) or different_paragraph(previous_line, line)): # Use 2 newlines to separate sections so that we # trigger proper Markdown processing on things like