Page MenuHomePhabricator

MediaWiki doesn't parse HTML table attributes within a template inclusion
Closed, ResolvedPublic

Description

Author: mail

Description:
I have the following template, named "Highlight":

<div style="border: 1px solid #0080FF;">
{{{1}}}

</div>

If I try to include the template with an table in that way

{{Highlight|

some cellsome cellsome cell
some cellsome cellsome cell

}}

everything is fine. But if I add a additional attribute to the table, tr or td tag, the page is not rendered properly, only showing "{{{1}}}" as content of the div element defined in Template:Highlight.

{{Highlight|
<table class="wikitable">
<tr>
<td>some cell</td>
<td>some cell</td>
<td>some cell</td>
</tr><tr>
<td>some cell</td>
<td>some cell</td>
<td>some cell</td>
</tr>
</table>

}}

This shouldn't be the expected behaviour. BTW: Why is it impossible to match nested template inclusions against a regular pattern, so that the pipe hiding ("|" to e.g. {{!}}) is not neccessary? I would wish that something like that is possible in a near future version of MediaWiki:

{{someTemplate|
{|

+ some table
-
content
content
-
}

}}


Version: 1.16.x
Severity: major

Details

Reference
bz28252

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:33 PM
bzimport set Reference to bz28252.
bzimport added a subscriber: Unknown Object (MLST).

If the parameter contains a "=", you have to use it like this:

{{Highlight|1=
...
}}

*** This bug has been marked as a duplicate of bug 14235 ***

M8R-cyc3n3 wrote:

This shouldn't be the expected behaviour. BTW: Why is it impossible to match
nested template inclusions against a regular pattern, so that the pipe hiding
("|" to e.g. {{!}}) is not neccessary? I would wish that something like that
is possible in a near future version of MediaWiki:

depending on rené's actual needs, passing some table-generating template as a
parameter might be easier and more scrutable than using {{!}}.

{{someTemplate|

{{make_some_table
| caption = some table
| c1 = content
| c2 = content
}}

}}