summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2018-08-05 09:26:12 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-08-05 09:26:12 (GMT)
commit8d24e13c1caddd6163972cb6bb7c58815346a202 (patch) (side-by-side diff)
tree46542db83f8158523e626ed560f50698181f51b1
parenta4917480cc989ce2cbaee79345149a7be22eccac (diff)
downloadwikitrans-8d24e13c1caddd6163972cb6bb7c58815346a202.tar.gz
wikitrans-8d24e13c1caddd6163972cb6bb7c58815346a202.tar.bz2
Fix parsing of closed tags with whitespace before '/>'
* WikiTrans/wikimarkup.py (BaseWikiMarkup.otag): Fix the P<args> named part so that it cannot start with a slash.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--WikiTrans/wikimarkup.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/WikiTrans/wikimarkup.py b/WikiTrans/wikimarkup.py
index 0987da2..6cbf5de 100644
--- a/WikiTrans/wikimarkup.py
+++ b/WikiTrans/wikimarkup.py
@@ -92,7 +92,7 @@ class TagAttributes(object):
class BaseWikiMarkup(object):
delim = re.compile("^==+[ \t]*|[ \t]*==+[ \t]*$|(^----$)|^\\*+|^#+|^[;:]+|(\\[\\[)|\\[|(\\{\\{)|(\\]\\])|\\]|(\\}\\})|\\||(\\'\\'\\'?)|<")
- otag = re.compile("<(?P<tag>[a-zA-Z0-9_]+)(?:\s+(?P<args>[^>]+))?\s*(?P<closed>/)?>")
+ otag = re.compile("<(?P<tag>[a-zA-Z0-9_]+)(?:\s+(?P<args>[^/][^>]+))?\s*(?P<closed>/)?>")
ctag = re.compile("</(?P<tag>[a-zA-Z0-9_]+)\s*>")
refstart = re.compile("^https?://")

Return to:

Send suggestions and report system problems to the System administrator.