]> khamidou — GitHub mirrors - rfcspot.git/commitdiff
Handle diagrams better
authorKarim Hamidou <khamidou@gmail.com>
Sat, 26 Mar 2016 22:55:07 +0000 (15:55 -0700)
committerKarim Hamidou <khamidou@gmail.com>
Sat, 26 Mar 2016 22:55:07 +0000 (15:55 -0700)
src/render_rfc.py

index 3cc07ee3bc74e362f5922e4c2b31bd744479bf7c..21a2a87592825d36fdb1fe4f37443c2617872fbe 100644 (file)
@@ -106,7 +106,7 @@ def create_paragraphs(data, **kwargs):
 
 def create_diagram_blocks(data, **kwargs):
     # A boxed diagram usually starts by +-- and ends by ---+.
-    diagram_regexp = re.compile(r"(\s*\+(-){2,}.+(-){2,}\+)", re.MULTILINE | re.DOTALL)
+    diagram_regexp = re.compile(r"(\s*\+(-){2,}.+?(-){2,}\+)\n\n", re.MULTILINE | re.DOTALL)
     data = diagram_regexp.sub(r'<pre>\1\n</pre>\n', data)
 
     # Some diagrams aren't boxed but contain a lot of ----