Skip to content
Browse files

[offline-renderer] change % to %25 so wr_parder.php will not expand

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent a3b446f commit fcd515c24964dbca9fb75ca2ac0229a9927e7424 @hxw hxw committed Oct 30, 2009
Showing with 8 additions and 6 deletions.
  1. +8 −6 host-tools/offline-renderer/ArticleParser.py
View
14 host-tools/offline-renderer/ArticleParser.py
@@ -33,19 +33,21 @@
(re.compile(r'\[\[\w\w:(\[\[[^\]\[]*\]\]|[^\]\[])*\]\]', re.IGNORECASE), ''),
-# Wikipedia's installed Parser extension tags
-# <categorytree>, <charinsert>, <hiero>, <imagemap>, <inputbox>, <poem>,
-# <pre>, <ref>, <references>, <source>, <syntaxhighlight> and <timeline>
-# All referenced using special characters
-# Ex: <timeline> --> &lt;timeline&gt;
-# For now, we're only going to remove <timeline>
+ # Wikipedia's installed Parser extension tags
+ # <categorytree>, <charinsert>, <hiero>, <imagemap>, <inputbox>, <poem>,
+ # <pre>, <ref>, <references>, <source>, <syntaxhighlight> and <timeline>
+ # All referenced using special characters
+ # Ex: <timeline> --> &lt;timeline&gt;
+ # For now, we're only going to remove <timeline>
(re.compile(r'\s*(<|&lt;)timeline(>|&gt;).*?(<|&lt;)/timeline(>|&gt;)', re.IGNORECASE + re.DOTALL), ''),
(re.compile(r'\s*(<|&lt;)imagemap(>|&gt;).*?(<|&lt;)/imagemap(>|&gt;)', re.IGNORECASE + re.DOTALL), ''),
(re.compile(r'(<|&lt;).*?(>|&gt;)', re.IGNORECASE), ''),
(re.compile(r'&amp;([a-zA-Z]{2,8});', re.IGNORECASE), r'&\1;')
+ # change % so php: wr_parser does not convert them
+ (re.compile(r'%', re.IGNORECASE), r'%25')
]

0 comments on commit fcd515c

Please sign in to comment.
Something went wrong with that request. Please try again.