Last modified: 2011-04-21 07:27:32 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 T27794, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25794 - disallow multiple table captions
disallow multiple table captions
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
http://de.wikipedia.org/w/index.php?t...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-05 12:59 UTC by Bergi
Modified: 2011-04-21 07:27 UTC (History)
4 users (show)

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


Attachments

Description Bergi 2010-11-05 12:59:44 UTC
Hello, you can generate more tahn one caption for a table with the wikisyntax
{|
|+ caption 1
|+ caption 2
|}
The problem is, Firefox doesn't show the further captions, just the the first one. It works in other Browsers (IE, Opera), so a page edited by a user with one of these browsers leads to a very different view in Firefox.
Comment 1 Bergi 2010-11-11 20:22:09 UTC
Could you please add an error message instead of the second (and following) captions?
Comment 2 Mark A. Hershberger 2011-04-14 19:49:56 UTC
If the table has no data, the display is messed up, but, otherwise, multiple captions can be displayed.

http://en.wikipedia.org/wiki/User:MarkAHershberger/Bug_Examples#Bug_25739
Comment 3 Bergi 2011-04-14 20:16:18 UTC
No, the invalid (?) table syntax (captions without cells) is not the issue of this bug.
I've addded a third example at your page, which generates a valid table. Firefox, also in version 4, doesn't show the second caption. Users of other browsers should be warned.
Comment 4 Mark A. Hershberger 2011-04-15 00:07:02 UTC
alright, the HTML being generated in those two cases is different.  When you put it in the wikitable class, actual caption elements are produced.  Otherwise, the caption is just stuffed in a <pre> tag.
Comment 5 Mark A. Hershberger 2011-04-15 00:12:48 UTC
Strike that.  Examples added to my demo.  When captions are first they're in a caption element.  When captions are last, they are in a <pre> element.
Comment 6 Mark A. Hershberger 2011-04-15 00:15:19 UTC
(In reply to comment #5)
> When captions are last, they are in a <pre> element.

Make that a <p> element.
Comment 7 Krinkle 2011-04-15 11:03:23 UTC
The W3C specification states the same, Firefox is correct here.

HTML4 says there may only be one element.

HTML5 is even stricter: it says it must be the first direct child of the table element (which also means there can only be one).


http://www.w3.org/TR/html4/struct/tables.html#h-11.2.2
> A TABLE element may only contain one CAPTION element.

http://www.w3.org/TR/html5/tabular-data.html#the-caption-element
> As the first element child of a table element.
Comment 8 Mark A. Hershberger 2011-04-15 14:11:07 UTC
I understand that it is in the spec.  That makes complete sense.

We haven't given the user a warning when they didn't put the caption before the row data -- we just worked around it.  Starting to warn when they do something wonky seems bad, too.   The only case I'm aware of that we provide warning is in the Cite extension when there is no <references> tag.
Comment 9 DieBuche 2011-04-18 09:25:34 UTC
Does anyone oppose to stripping any nth>1 caption in the parser?
Comment 10 Mark A. Hershberger 2011-04-18 13:22:25 UTC
(In reply to comment #9)
> Does anyone oppose to stripping any nth>1 caption in the parser?

That seems fine to me since it would make the mis-placed captions work the same as those placed correctly.

Now, if you're going to strip captions, maybe we can have a look at making captions work the same no matter where they're placed.  But that's another bug.
Comment 11 DieBuche 2011-04-18 13:25:54 UTC
> Now, if you're going to strip captions, maybe we can have a look at making
> captions work the same no matter where they're placed.  But that's another bug.
I actually fixed that when implementing thead&tfoot. Do you have a bug id?
Comment 12 Mark A. Hershberger 2011-04-18 13:29:30 UTC
(In reply to comment #11)
> > Now, if you're going to strip captions, maybe we can have a look at making
> > captions work the same no matter where they're placed.  But that's another bug.
> I actually fixed that when implementing thead&tfoot. Do you have a bug id?

No, I would have had to create one. Thanks!
Comment 13 DieBuche 2011-04-21 07:27:32 UTC
Fixed in r86599

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


Navigation
Links