Last modified: 2013-06-08 15:26:47 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 27786 - let empty metadata-elements pass through tidy
let empty metadata-elements pass through tidy
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: tidy
  Show dependency treegraph
Reported: 2011-02-28 16:00 UTC by Bergi
Modified: 2013-06-08 15:26 UTC (History)
7 users (show)

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


Description Bergi 2011-02-28 16:00:41 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.
Comment 1 Fomafix 2011-03-01 14:22:00 UTC
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>”
Comment 2 Jesús Martínez Novo (Ciencia Al Poder) 2012-09-29 20:17:49 UTC
MediaWiki strips empty SPAN attributes, but not empty DIV. See:
Comment 3 Bergi 2012-10-01 10:24:33 UTC
(In reply to comment #2)
> MediaWiki strips empty SPAN attributes, but not empty DIV.

Sure, but this bug is about empty spans.
The mentioned metadata format even /specifies/ the use of <span> tags...

Btw, <div style="display:inline;"> is a horrible workaround for <span>.
Comment 4 Fomafix 2012-10-02 15:17:41 UTC
  <div class="…" style="display:inline;" />

is not a workaround for

  <span class="…" />


  A<div class="…" style="display:inline;" />B


Comment 5 Jesús Martínez Novo (Ciencia Al Poder) 2012-10-02 18:20:48 UTC
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>


  A B

Notice it's all surrounded by an additional DIV.</rant>
Comment 6 Fomafix 2012-10-04 07:46:36 UTC
(In reply to comment #5)
>   <div>A<div class="…" style="display:inline;" />B</div>
> generates
>   A B

Yes, but expected result is


without a whitespace.

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