[gtk-doc] mkdb: handle special chars in verbatim blocks



commit 3fe349c4bbaa1d206b60ad76c06f8f96dffa3651
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon May 7 22:29:02 2018 +0200

    mkdb: handle special chars in verbatim blocks
    
    Handle '<' in a verbatim block.
    
    Fixes #795744

 gtkdoc/mkdb.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc/mkdb.py b/gtkdoc/mkdb.py
index e844e8f..20eb389 100644
--- a/gtkdoc/mkdb.py
+++ b/gtkdoc/mkdb.py
@@ -2556,7 +2556,9 @@ def ConvertSGMLChars(symbol, text):
     # For the simple non-sgml mode, convert to entities everywhere.
 
     text = re.sub(r'&(?![a-zA-Z#]+;)', r'&amp;', text)        # Do this first, or the others get messed up.
-    text = re.sub(r'<', r'&lt;', text)
+    # Allow '<' in verbatim markdown
+    # TODO: we don't want to convert any of them between ``
+    text = re.sub(r'(?<!`)<', r'&lt;', text)
     # Allow '>' at beginning of string for blockquote markdown
     text = re.sub(r'''(?<=[^\w\n"'\/-])>''', r'&gt;', text)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]