[Pywikipedia-svn] SVN: [7310] trunk/pywikipedia/fixes.py
siebrand at svn.wikimedia.org
siebrand at svn.wikimedia.org
Fri Sep 25 00:23:44 UTC 2009
Revision: 7310
Author: siebrand
Date: 2009-09-25 00:23:44 +0000 (Fri, 25 Sep 2009)
Log Message:
-----------
[#2814780] Add fckeditor fix. Patch by almaghi
Modified Paths:
--------------
trunk/pywikipedia/fixes.py
Modified: trunk/pywikipedia/fixes.py
===================================================================
--- trunk/pywikipedia/fixes.py 2009-09-25 00:18:58 UTC (rev 7309)
+++ trunk/pywikipedia/fixes.py 2009-09-25 00:23:44 UTC (rev 7310)
@@ -18,7 +18,9 @@
* datum - specific date formats in German
* correct-ar - Corrections for Arabic Wikipedia and any Arabic wiki.
* yu-tld - the yu top-level domain will soon be disabled, see
+ * fckeditor - Try to convert FCKeditor HTML tags to wiki syntax.
http://lists.wikimedia.org/pipermail/wikibots-l/2009-February/000290.html
+
"""
fixes = {
@@ -42,7 +44,7 @@
'nl':u'Bot: conversie/reparatie HTML',
'pl':u'Robot konwertuje/naprawia HTML',
'pt':u'Bot: Corrigindo HTML',
- 'ru':u'Бот: коррекция HTML',
+ 'ru':u'Бот: коррекция HTML',
'sr':u'Бот: Поправка HTML-а',
'sv':u'Bot: Konverterar/korrigerar HTML',
'uk':u'Бот: корекцiя HTML',
@@ -53,9 +55,9 @@
# Keep in mind that MediaWiki automatically converts <br> to <br />
# when rendering pages, so you might comment the next two lines out
# to save some time/edits.
- #r'(?i)<br>': r'<br />',
+ #(r'(?i)<br>', r'<br />'),
# linebreak with attributes
- #r'(?i)<br ([^>/]+?)>': r'<br \1 />',
+ #(r'(?i)<br ([^>/]+?)>', r'<br \1 />'),
(r'(?i)<b>(.*?)</b>', r"'''\1'''"),
(r'(?i)<strong>(.*?)</strong>', r"'''\1'''"),
(r'(?i)<i>(.*?)</i>', r"''\1''"),
@@ -247,7 +249,7 @@
'cs':u'Oprava wikisyntaxe',
'de':u'Bot: Korrigiere Wiki-Syntax',
'en':u'Bot: Fixing wiki syntax',
- 'eo':u'Bot: Korektado de vikia sintakso',
+ 'eo':u'Bot: Korektado de vikia sintakso',
'fr':u'Bot: Corrige wiki-syntaxe',
'he':u'בוט: מתקן תחביר ויקי',
'ia':u'Robot: Reparation de syntaxe wiki',
@@ -256,9 +258,9 @@
'nl':u'Bot: reparatie wikisyntaxis',
'pl':u'Robot poprawia wiki-składnię',
'pt':u'Bot: Corrigindo sintaxe wiki',
- 'ru':u'Бот: Коррекция вики синтаксиса',
+ 'ru':u'Бот: Коррекция вики синтаксиса',
'sr':u'Бот: Поправка вики синтаксе',
- 'uk':u'Бот: Корекцiя вiкi-синтаксису',
+ 'uk':u'Бот: Корекцiя вiкi-синтаксису',
'zh':u'機器人: 修正wiki語法',
},
'replacements': [
@@ -623,6 +625,20 @@
(u'www.drzavnauprava.sr.gov.yu', u'www.drzavnauprava.gov.rs'),
],
},
+ # These replacements will convert HTML tag from FCK-editor to wiki syntax.
+ #
+ 'fckeditor': {
+ 'regex': True,
+ 'msg': {
+ 'en': u'Robot: Fixing rich-editor html',
+ },
+ 'replacements': [
+ # replace <br> with a new line
+ (r'(?i)<br>', r'\n'),
+ # replace with a space
+ (r'(?i) ', r' '),
+ ],
+ },
}
#
More information about the Pywikipedia-svn
mailing list