Skip to content

Commit

Permalink
[offline-renderer] change % to %25 so wr_parder.php will not expand
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information
hxw committed Oct 30, 2009
1 parent a3b446f commit fcd515c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions host-tools/offline-renderer/ArticleParser.py
Expand Up @@ -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')
]


Expand Down

0 comments on commit fcd515c

Please sign in to comment.