[gtk-doc] mkdb: avoid regexp for simple search and replace



commit be761684010a314fd962ec58914e631605724e2e
Author: Stefan Sauer <ensonic users sf net>
Date:   Fri Jun 16 23:34:15 2017 +0200

    mkdb: avoid regexp for simple search and replace

 gtkdoc/mkdb.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc/mkdb.py b/gtkdoc/mkdb.py
index e03763f..99a9913 100644
--- a/gtkdoc/mkdb.py
+++ b/gtkdoc/mkdb.py
@@ -2508,9 +2508,9 @@ def CreateValidSGML(text):
         str: escaped input
     """
 
-    text = re.sub(r'&', r'&amp;', text)        # Do this first, or the others get messed up.
-    text = re.sub(r'<', r'&lt;', text)
-    text = re.sub(r'>', r'&gt;', text)
+    text = text.replace('&', '&amp;')        # Do this first, or the others get messed up.
+    text = text.replace('<', '&lt;')
+    text = text.replace('>', '&gt;')
     # browsers render single tabs inconsistently
     text = re.sub(r'([^\s])\t([^\s])', r'\1&#160;\2', text)
     return text


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