Last modified: 2014-01-13 17:39:48 UTC
Currently, the code of reference item in reference list is: <li id="cite_note-1"> <span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Lorem ipsum.</span> </li> This is wrong, because it disallows block elements in references. (In fact, if one puts the block elements there, they are being converted by Tidy in very unpredictable way.) The easiest solution is to remove the <span class="reference-text"> wrapper.
Could you please add an example URL or explain a common case that contains block elements?
I tried to find a case where this could be a problem but even with a table within the reference it just simply puts a span before and after the table element. If anyone finds a case where this is unpredictable or a block element that doesn't work please post it and I will look at this further.
(In reply to comment #2) > it just simply puts a span before and after the table Which is semantically wrong. It's not allowed to put block elements into inline elements. Web browsers are able to deal with almost every bad HTML but it is still wrong.
Just to confirm we are talking about the same thing: <span> span1 </span> <table> stuff </table> <span> span2 </span> Is wrong? when I said before and after I meant it creates a separate span before and after the block element for the rest of the reference.
I'm sorry but it seems we are not talking about the same. When I enter this: <ref name="t"> {| |t |}</ref> <references /> in a local MediaWiki with Tidy disabled I get this: <ol class="references"> <li id="cite_note-t-1"><span class="mw-cite-backlink"><a href="#cite_ref-t_1-0">↑</a></span> <span class="reference-text"> <table> <tr> <td>t </td></tr></table></span> </li> </ol> This HTML is wrongly nested. Because of this Tidy tries to fix it. It becomes: <ol class="references"> <li id="cite_note-t-1"><span class="mw-cite-backlink"><a href="#cite_ref-t_1-0">↑</a></span> <table> <tr> <td>t</td> </tr> </table> </li> </ol> As you can see the class="reference-text" is simply deleted. This is not good. The class should be there no matter what is inside of the reference.
(In reply to comment #0) > The easiest solution is to remove the <span class="reference-text"> wrapper. I was playing around with different possible solutions (switching to a DIV depending on the text, adding default styles) and I agree. The wrapper should simply be removed.
(In reply to comment #6) > The wrapper should simply be removed. The class refernce-text is used in some places to detect the actual content of a reference, including in the script ext.cite.popups.js provided by the extension itself. The fact that Tidy sometimes removes that class is bug 38661.
> The class refernce-text is used in some places to detect the actual content > of a reference, including in the script ext.cite.popups.js provided by the > extension itself. so it should still remain in ext.cite.popup.js ?
*** Bug 38661 has been marked as a duplicate of this bug. ***
(In reply to comment #8) > so it should still remain in ext.cite.popup.js ? The most simple and straightforward fix is to use a <div ...> instead of the <span class="reference-text"> and add .reference-text { display: inline; } to all screen and print CSS files (don't forget print). This solution may need additional tweaking. But in my opinion it should be done in any case. If it causes other issues these issues should be fixed separately.