[Mediawiki-l] Maintaining newline as first line of a template

Jack D. Pond jack.pond at psitex.com
Thu Jan 21 16:02:44 UTC 2010


MW 1.15.1 (and before)

Does anyone know what causes this and how to remedy?

Wiki code only recognizes table commands ("{|", "|-", "|}") when they begin
on a new line.  Therefore if your template is using these commands, the
first line of your template MUST be a newline - otherwise the wiki code is
likely to be continued on the line in which it is referenced.

In the  mediawiki article editor, this newline is stripped when it is
re-edited and must be manually reinserted. So if you create a template such
as this (note the necessary preceeding empty new line): 
--------

{| class="smwtable sortable"
! Col Hdr 1
! Col Hdr 2
--------

When you go in and edit again - even though the preceeding new line had been
saved, it will be removed, and you will need to add it again. Example,
before line reinserted: 

--------
{| class="smwtable sortable"
! Col Hdr 1
! Col Hdr 2
--------

Any ideas?

Jack




More information about the MediaWiki-l mailing list