[gtk-doc] mkdb: avoid regexp for simple search and replace
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkdb: avoid regexp for simple search and replace
- Date: Fri, 16 Jun 2017 21:34:45 +0000 (UTC)
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'&', text) # Do this first, or the others get messed up.
- text = re.sub(r'<', r'<', text)
- text = re.sub(r'>', r'>', text)
+ text = text.replace('&', '&') # Do this first, or the others get messed up.
+ text = text.replace('<', '<')
+ text = text.replace('>', '>')
# browsers render single tabs inconsistently
text = re.sub(r'([^\s])\t([^\s])', r'\1 \2', text)
return text
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]