Hi,
I want to implement something similar to ~~~~ expansion or the pipe-trick in internal links in an extension.
That is, I need to execute code - on save and preview only, - on wikitext ony, - on page content only, - before the pre-save-parser treats links in the wikitext, - altering the wikitext of the page.
I tried several hooks and ideas, but was unable to make it specific enough.
Help is appreciated.
Thank you.
Purodha
Look how subst: works in the braceSubstitution function in Parser.php. Basically, do this: if ( $parser->ot['wiki'] ) { /* do your stuff */ }.
On Sat, Nov 14, 2015 at 5:36 PM, Purodha Blissenbach < purodha@blissenbach.org> wrote:
Hi,
I want to implement something similar to ~~~~ expansion or the pipe-trick in internal links in an extension.
That is, I need to execute code
- on save and preview only,
- on wikitext ony,
- on page content only,
- before the pre-save-parser treats links in the wikitext,
- altering the wikitext of the page.
I tried several hooks and ideas, but was unable to make it specific enough.
Help is appreciated.
Thank you.
Purodha
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 11/14/2015 05:36 PM, Purodha Blissenbach wrote:
Hi,
I want to implement something similar to ~~~~ expansion or the pipe-trick in internal links in an extension.
That is, I need to execute code
- on save and preview only,
- on wikitext ony,
- on page content only,
- before the pre-save-parser treats links in the wikitext,
- altering the wikitext of the page.
I tried several hooks and ideas, but was unable to make it specific enough.
Did you try https://www.mediawiki.org/wiki/Manual:Hooks/ArticlePrepareTextForEdit ?
Matt Flaschen
wikitech-l@lists.wikimedia.org