Added support for hacky use of dl before tables.

* This is the equivalent of commit a0746946 to
  core/includes/Parser.php

Change-Id: Id093e39dabad29cb275bd21325d39bfeb7709d98
This commit is contained in:
Subramanya Sastry 2012-07-02 17:57:56 -05:00 committed by Gabriel Wicke
parent f43f2d61c8
commit c5f9961423

View file

@ -1435,7 +1435,7 @@ block_tag
/*********************************************************
* Lists
*********************************************************/
lists = (dtdd / li) (sol (dtdd / li))*
lists = (dtdd / hacky_dl_uses / li) (sol (dtdd / hacky_dl_uses / li))*
li = bullets:list_char+
c:inlineline?
@ -1448,6 +1448,26 @@ li = bullets:list_char+
return [ li, c ];
}
/*
* This production is required to support wikitext of this form
* ::{|border="1"|foo|bar|baz|}
* where the leading colons are used to indent the entire table.
* This hack was added back in 2006 in commit
* a0746946312b0f1eda30a2c793f5f7052e8e5f3a based on a patch by Carl
* Fürstenberg.
*/
hacky_dl_uses = bullets:":"+
c:table_lines
&eolf
{
if ( c === '' )
c = [];
var li = new TagTk( 'listItem', [], { tsr: [pos0, pos0 + bullets.length] } );
li.bullets = bullets;
return [ li, c ];
}
dtdd
= bullets:(!(";" !list_char) lc:list_char { return lc })*
";"