From: Karim Hamidou Date: Sat, 26 Mar 2016 22:52:51 +0000 (-0700) Subject: handle C: S: lines correctly. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6d6d5cc0c3632b9ac66430ceb0a76eba4a104624;p=rfcspot.git handle C: S: lines correctly. --- 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)