Last modified: 2014-01-13 17:39:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 47544 - <references/> list item must not wrap the text in <span>
<references/> list item must not wrap the text in <span>
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Low minor with 1 vote (vote)
: ---
Assigned To: Tony Thomas
usability
: easy
: 38661 (view as bug list)
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2013-04-23 11:51 UTC by Danny B.
Modified: 2014-01-13 17:39 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Danny B. 2013-04-23 11:51:10 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.
Comment 1 TMg 2013-05-14 18:20:06 UTC
Could you please add an example URL or explain a common case that contains block elements?
Comment 2 Rohan Verma 2013-05-23 14:11:21 UTC
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.
Comment 3 TMg 2013-05-23 21:15:03 UTC
(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.
Comment 4 Rohan Verma 2013-05-25 04:57:22 UTC
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.
Comment 5 TMg 2013-05-25 08:12:39 UTC
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.
Comment 6 TMg 2013-05-25 08:43:23 UTC
(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.
Comment 7 Michael M. 2014-01-10 11:01:03 UTC
(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.
Comment 8 Tony Thomas 2014-01-10 18:06:18 UTC
> 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 ?
Comment 9 TMg 2014-01-13 17:31:37 UTC
*** Bug 38661 has been marked as a duplicate of this bug. ***
Comment 10 TMg 2014-01-13 17:39:48 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links