Page MenuHomePhabricator

replaceCategoryInPlace doesn't work if left-to-right mark is in the wikitext of the old category name
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

python3 pwb.py shell
>>> site = pywikibot.Site('en', 'wikipedia')
>>> text = '[[Category:Ignore me]]\n[[Category:Old\u200e]]'
>>> oldcat = pywikibot.Category(site, 'Old')
>>> newcat = pywikibot.Category(site, 'New')
>>> newtext = pywikibot.textlib.replaceCategoryInPlace(text, oldcat, newcat, site=site)
>>> newtext

Actual Results:

'[[Category:Ignore me]]\n[[Category:Old\u200e]]'

Expected Results:

'[[Category:Ignore me]]\n[[Category:New]]'

Event Timeline

Maybe it understands it as a part of the category title?

Change 555693 had a related patch set uploaded (by JJMC89; owner: JJMC89):
[pywikibot/core@master] [FIX] replaceCategoryInPlace: Allow LRM and RLM at the end of the old category name

https://gerrit.wikimedia.org/r/555693

Change 555693 merged by jenkins-bot:
[pywikibot/core@master] [FIX] replaceCategoryInPlace: Allow LRM and RLM at the end of the old_cat title

https://gerrit.wikimedia.org/r/555693