MediaWiki Weirdness: Difference between revisions

From evermeet.cx Wiki
Jump to navigation Jump to search
Created page with "== Introduction == I spent hours trying to debug some strange behaviour in [https://www.mediawiki.org/wiki/MediaWiki MediaWiki] and thought the solution might be beneficial t..."
 
No edit summary
Line 1: Line 1:
== Introduction ==
== Introduction ==


I spent hours trying to debug some strange behaviour in [https://www.mediawiki.org/wiki/MediaWiki MediaWiki] and thought the solution might be beneficial to others.
I spent hours trying to debug some strange behaviour in [https://www.mediawiki.org/wiki/MediaWiki MediaWiki] and thought the solution, which I got from someone on IRC, might be beneficial to others.


When using a [https://www.mediawiki.org/wiki/Help:Templates template], which invokes a [https://www.mediawiki.org/wiki/Lua_scripting LUA module], an additional line is added before the output. Turns out a bug [https://phabricator.wikimedia.org/T14974 T14974] has been filed a while back, but it looks like there's no desire to fix it.
When using a [https://www.mediawiki.org/wiki/Help:Templates template], which invokes a [https://www.mediawiki.org/wiki/Lua_scripting LUA module], an additional line is added before the output. Turns out a bug [https://phabricator.wikimedia.org/T14974 T14974] has been filed a while back, but it looks like there's no desire to fix it.

Revision as of 20:45, 23 October 2017

Introduction

I spent hours trying to debug some strange behaviour in MediaWiki and thought the solution, which I got from someone on IRC, might be beneficial to others.

When using a template, which invokes a LUA module, an additional line is added before the output. Turns out a bug T14974 has been filed a while back, but it looks like there's no desire to fix it.

Example

Invoking the module directly works as intended:

{{#invoke:module|func|...}}

Output here.

But when using a template, which calls the module, an additional line is prepended:

{{template_which_invokes_module|...}}

 
Output here.

Solution

In the template, add <nowiki /> before invoking the module:


<nowiki />{{#invoke:module|func}}