Page MenuHomePhabricator

Publish a Python script to handle the SyntaxHighlight deprecations
Closed, DeclinedPublic


@JJMC89 wrote a Python script using Pywikibot and mwparserfromhell. It does not cover 1A (below), but that syntax is not common.

  1. Is this something that will be useful to keep around for the long term?
  2. Given 1, should it be published in Pywikibot-Scripts or elsewhere?
SyntaxHighlight deprecations
  1. The <source> tag is deprecated. <syntaxhighlight> should be used instead.
    1. {{#tag:source|...}}{{#tag:syntaxhighlight|...}} too
  2. The enclose parameter is deprecated. If set to "none" it, should be replaced by the inline parameter. Otherwise, it should be removed.

Event Timeline

JJMC89 created this object with edit policy "Trusted-Contributors (Project)".

I think can be used to replace the tags, probably is might be used for settings if the repace options to be used looks too complicated

Yeah, I would say is enough, no need to write special script. I am using on cswiki for these fixes too.

Probably we can publish a fixes dict entry like:

'source': {
    'generator': [
    'regex': True,
    'msg': {
        'en': 'Bot: Replace deprecated <source> tag',
        'de': 'Bot: Ersetze veraltetes <source> tag',
    'replacements': [
        (r'<source((?:| .*))>', r'<syntaxhighlight\1>'),
        (r'</source\s*>', r'</syntaxhighlight>'),

@JJMC89 Why did you create this with a custom edit policy?

Urbanecm changed the edit policy from "Trusted-Contributors (Project)" to "All Users".Apr 21 2020, 5:32 PM
Urbanecm added a subscriber: Urbanecm.

@JJMC89 Why did you create this with a custom edit policy?

I don't see a reason either, changed back to the default.

@JJMC89: Please do not remove tags for no good reason - thanks!