It looks like you're using the old way of doing magic words, which stopped working in 1.19.
See https://www.mediawiki.org/wiki/Manual:Magic_words#Behavior_switches_(double_underscore_magic_words) for the new way of doing this. Second of all, you should not use OutputPage inside the parser (you need to use ParserOutput). Otherwise, the results will only work on non-cached pages. Instead of $out->addModule, use $parser->getOutput()->addModules() It is also possible that the javascript might load before the page loads, so it should probably be inside a onDOMContentLoaded callback (E.g. the $() operator). Alternatively the CSS could just be changed to do for both the ToC and non-TOC case and then the JS wouldn't be necessary, and not using JS would make things show up instantly instead of having a short flash where things weren't numbered (Assuming that addModuleStyles was used instead of addModules()) . -- Brian On Sun, Sep 11, 2022 at 8:36 PM Zoran Dori <[email protected]> wrote: > Hello, > I'm trying to make > https://www.mediawiki.org/wiki/Extension:MagicNumberedHeadings working, > having in mind that Parser method setNumberHeadings is removed from > MediaWiki. > > This is my code so far https://github.com/kizule/NumberedHeadings, and > it's not doing anything, I would love to get some suggestions on how to > make it work. > > Currently, it's not doing anything ( > https://oer.opendeved.net/wiki/OER4Schools), it should remove the tag > from the page, and make headings numbered where the tag is added. > > I've used Krinkle's snippet from MediaWiki.org in form of gadgets, and > it's working fine, but it's not removing tag and it is being executed on > every single page. > > Best regards, > Zoran > _______________________________________________ > MediaWiki-l mailing list -- [email protected] > To unsubscribe send an email to [email protected] > > https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
_______________________________________________ MediaWiki-l mailing list -- [email protected] To unsubscribe send an email to [email protected] https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
