Last modified: 2013-06-08 15:26:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29786, the corresponding Phabricator task for complete and up-to-date bug report information.
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)
unspecified
All All
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://de.wikipedia.org/wiki/Wikipedi...
:
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: ---


Attachments

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:

http://www.mediawiki.org/w/index.php?oldid=588727&action=edit&preview=yes
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 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>.
Comment 4 Fomafix 2012-10-02 15:17:41 UTC
  <div class="…" style="display:inline;" />

is not a workaround for

  <span class="…" />

because

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

generates

  A
  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>

generates

  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

   AB

without a whitespace.

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


Navigation
Links