Last modified: 2010-05-15 15:33:42 UTC
In templates that consist of tables, every transclusion after the first inserts excess whitespace in the form of <p><br /></p> above the transclusion. Reduced test case: [[User:Flamurai/Transclusion]] Real world example: [[Names of God in Judaism]]. The code is: ... use God's name in a similar fashion. {{listen|filename=He-El.ogg|title=El|description=|format=[[Ogg]]}} This produces the HTML: use God's name in a similar fashion.</p> <p><br /></p> <table cellspacing="0" border="0" align="left" style=" margin-left: 0.5em; color: inherit; background-color: transparent; position: relative; left: -8px;"> <tr style="vertical-align: top;"> <td rowspan="3" style="width: 30px; padding-right: 3px; padding-top: 4px; vertical-align: top;"> ... That <p><br /></p> is producing excess whitespace. However, the first time the template's included there's no problem with the code: ... sometimes used to refer to a distinguished person. {{listen|filename=He-Adonai.ogg|title=Adonai|description=}} Which results in: ... is sometimes used to refer to a distinguished person.</p> <table cellspacing="0" border="0" align="left" style=" margin-left: 0.5em; color: inherit; background-color: transparent; position: relative; left: -8px;"> <tr style="vertical-align: top;"> <td rowspan="3" style="width: 30px; padding-right: 3px; padding-top: 4px; vertical-align: top;"> That extra paragraph is not there. This problem is also on [[History of music]].
See also bug 1343 and bug 1176.
After checking the bug 1343 and bug 1176 and doing some further testing, I've noticed a few things: 1. This only applies to templates that are wikitables, not to divs, HTML tables, etc. 2. The same phenomenon happens every time for each separate template. That is, if I use {{table1}} and {{table2}} multiple times, for each one, the first use will be fine, and every use thereafter will have excess whitespace. 3. If the template is the first element in the page, the problem is exactly the opposite! There is whitespace before the first transclusion, but every transclusion thereafter is fine. I updated [[User:Flamurai/Transclusion]] to encompass all these cases.
A temporary hack to fix this is to wrap the table in <div>...</div>, however the parser bug should still be found and fixed.
Marking it as a duplicate of bug 1343, which I solved 3 days ago. *** This bug has been marked as a duplicate of 1343 ***