From 6d6d5cc0c3632b9ac66430ceb0a76eba4a104624 Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Sat, 26 Mar 2016 15:52:51 -0700 Subject: [PATCH] handle C: S: lines correctly. --- src/render_rfc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render_rfc.py b/src/render_rfc.py index d644a60a..3cc07ee3 100644 --- a/src/render_rfc.py +++ b/src/render_rfc.py @@ -161,8 +161,8 @@ def render_communication_lines_correctly(data, **kwargs): # S: a001 OK CAPABILITY completed # C: a002 STARTTLS # so we need to insert line breaks between those. - client_rx = re.compile(r"^(.+)\s+([CS]\:)(.+)$", re.MULTILINE) - data = client_rx.sub(r"\1 \2 \3
", data) + client_rx = re.compile(r"""([^"']([CS]\:)[^"'](.+))""", re.MULTILINE) + data = client_rx.sub(r"
\1
", data) args_rx = re.compile(r"^ ((Arguments|Responses|Result):)(.+?\n\s*\n)", re.MULTILINE | re.DOTALL) data = args_rx.sub(r"\1
\3
", data) -- 2.43.0