| matej_suchanek added a comment. |
Broken test:
self.assertEqual('text [[title]] text', self.cct.cleanUpLinks('text[[ title ]]text')) self.assertEqual('text [[title|name]] text', self.cct.cleanUpLinks('text[[ title | name ]]text')) self.assertEqual('text[[title|name]]text', self.cct.cleanUpLinks('text[[ title |name]]text')) self.assertEqual('text [[title|name]]text', self.cct.cleanUpLinks('text[[title| name]]text'))
Live code:
if not trailingChars: labelLength = len(label) label = label.rstrip() hadTrailingSpaces = len(label) != labelLengthThe results are instead:
- text [[title ]]text - the space cannot be moved outside because of if not trailingChars:
- text [[title|name ]]text - same bug
- text[[title|nametext]] - linktrail goes inside the text
- text [[title|nametext]] - same bug
Fix for the last two is trivial, but the first two require some brainstorming because MediaWiki parses [[title ]]text to [[title|title text]], not [[title]] text which is the inteded result.
TASK DETAIL
EMAIL PREFERENCES
To: matej_suchanek
Cc: matej_suchanek, Aklapper, Xqt, pywikibot-bugs-list, Magul, Tbscho, MayS, Mdupont, JJMC89, jayvdb, Wesalius, Dalba, Masti, Alchimista, Rxy
Cc: matej_suchanek, Aklapper, Xqt, pywikibot-bugs-list, Magul, Tbscho, MayS, Mdupont, JJMC89, jayvdb, Wesalius, Dalba, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
