Last modified: 2013-06-08 15:26:47 UTC
The English and the German Wikipedia use the COinS microformat (see WP article) to embed citation metadata. It specifies a span with class="Z3988" and a title-parameter for the data. Usually the span is empty, but that does not work with MediaWiki: Tidy removes them (when they have no id). There are some hacks, but all of them include a element displayed on the screen, which shows its (ugly) title when hovering about it. I'm not sure how far a solution for this problem can go, but I propose tidy to let pass any empty element which has at least one attribute. If that is not desired, you may implement an exception matching exactly to this class attribute.
Actual result: “<span></span>” → “” “<span id="…"></span>” → “<span id="…"></span>” “<span class="…"></span>” → “” “<span style="…"></span>” → “” “<span title="…"></span>” → “” Expected result: “<span></span>” → “<span></span>” or “” “<span id="…"></span>” → “<span id="…"></span>” “<span class="…"></span>” → “<span class="…"></span>” “<span style="…"></span>” → “<span style="…"></span>” “<span title="…"></span>” → “<span title="…"></span>”
MediaWiki strips empty SPAN attributes, but not empty DIV. See: http://www.mediawiki.org/w/index.php?oldid=588727&action=edit&preview=yes
(In reply to comment #2) > MediaWiki strips empty SPAN attributes, but not empty DIV. Sure, but this bug is about empty spans. The mentioned http://en.wikipedia.org/wiki/COinS metadata format even /specifies/ the use of <span> tags... Btw, <div style="display:inline;"> is a horrible workaround for <span>.
<div class="…" style="display:inline;" /> is not a workaround for <span class="…" /> because A<div class="…" style="display:inline;" />B generates A B
Okay okay okay. Before anyone else comes to put any other example I just want to clarify that my comment was to: A) Notice the inconsistency between stripping empty SPAN vs DIV. I would expect none or both to be stripped. B) DIVs can be used WHERE APPROPIATE as a replacement (for example, to insert an empty element with an ID or CLASS for presentational changes or script manipulation). And about the last example, <div>A<div class="…" style="display:inline;" />B</div> generates A B Notice it's all surrounded by an additional DIV.</rant>
(In reply to comment #5) > <div>A<div class="…" style="display:inline;" />B</div> > > generates > > A B Yes, but expected result is AB without a whitespace.