Page MenuHomePhabricator

do not insert a space between "#" and "REDIRECT"
Closed, ResolvedPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1545/
Reported by: jandudik
Created on: 2012-11-28 10:51:03
Subject: pageform file and cosmetic changes
Original description:
I tried to made several redirects:
pagefromfile.py -start:XXX -end:XXX -file:hsb.txt -notitle -lang:hsb

where hsb.txt contained
XXX
'''Carex dioica'''
\#REDIRECT\[\[dwójna rězna\]\]
YYY
...

But bot imported article with cosmetic chages and there isn't \#REDIRECT but \# REDIRECT
http://hsb.wikipedia.org/w/index.php?title=Carex\_dioica&oldid=274441


Version: unspecified
Severity: normal
See Also:
https://sourceforge.net/p/pywikipediabot/bugs/1545

Details

Reference
bz55161

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:23 AM
bzimport set Reference to bz55161.

the easiest way is to switch off cosmetic\_changes when creating redirect pages. If cc is enabled by default you can use
pagefromfile.py -start:XXX -end:XXX -file:hsb.txt -notitle -lang:hsb -cc

If the page already exists that changes will not be made.

Disabling of a feature always solves problems with it. But it would be nice to fix cosmetic changes module so that it doesn't add a whitespace after \# in magic words and parser functions.

I aggree. But disabling that feature is the most easiest way to solve it ;\)

CosmeticChangesToolkit.putSpacesInLists() seems to be concerned.

Change 135166 had a related patch set uploaded by Ricordisamoa:
exclude redirects from CosmeticChangesToolkit.putSpacesInLists()

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

Change 135166 merged by jenkins-bot:
exclude redirects from CosmeticChangesToolkit.putSpacesInLists()

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

Change 136627 had a related patch set uploaded by Ricordisamoa:
backport Ic8ef2868ef9c55a1cec57a17f5601652918a62c7 from core

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

Change 136627 merged by jenkins-bot:
backport Ic8ef2868ef9c55a1cec57a17f5601652918a62c7 from core

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

It has been resolved since the patches have been merged ;-)
Anyway, tested.