Skip to content
This repository was archived by the owner on Feb 4, 2021. It is now read-only.

FFU: cleanup #195

Open
wikipedia-mabdul opened this issue Oct 8, 2013 · 4 comments
Open

FFU: cleanup #195

wikipedia-mabdul opened this issue Oct 8, 2013 · 4 comments

Comments

@wikipedia-mabdul
Copy link
Member

There are regular users (requester) providing full information and templates for proposed uploads like:

''License:''' {{Non-free logo|image has rationale=yes}}

The cleanup should transform that stuff to

'''License:''' {{tlx|Non-free logo|<nowiki>image has rationale=yes</nowiki>}}

see edit by [[User:Armbrust]]

https://en.wikipedia.org/w/index.php?title=Wikipedia:Files_for_upload&curid=9176046&diff=576246132&oldid=576225994

@Technical-13
Copy link
Contributor

I would think {{tlx|Non-free logo|image has rationale{{=}}yes}} would not only look better but be easier to do than trying to wrap things in <nowiki>...</nowiki> tags.

.replace(/\{\{(.*?)\}\}/g, '{{tlx|$1}}').replace('=', '{{=}}');

@wikipedia-mabdul
Copy link
Member Author

you missed to replace the additional pipes so another

.replace(/\{\{(.*?)\}\}/g, '{{tlx|$1}}').replace(/=/g, '{{=}}').replace(/\|/g, '{{!}}');

and then

.replace(/\{\{\!\}\}/, '\|');

(first global, then one time rereplace)

@wikipedia-mabdul
Copy link
Member Author

but actually it IS easier...

.replace(/\{\{(.*?)\}\}/g, '{{tlx|\<nowiki\<$1\<\/nowiki\>}}');

not really that hard, if you check the above code...

@wikipedia-mabdul
Copy link
Member Author

and... btw: this is a bad regex.

moreover we would detect ALL templates (also afc comments, archive bottom etc...)

I'm working on that

@ghost ghost assigned wikipedia-mabdul Oct 8, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants