Last modified: 2013-07-04 10:34:11 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 T45836, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43836 - Set title attribute in inline images and support editing
Set title attribute in inline images and support editing
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks: ve-mediasupport 46576
  Show dependency treegraph
 
Reported: 2013-01-10 19:48 UTC by Roan Kattouw
Modified: 2013-07-04 10:34 UTC (History)
2 users (show)

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


Attachments

Description Roan Kattouw 2013-01-10 19:48:02 UTC
The wikitext:

Foo [[File:Frisian flag.svg|simple caption|thumb]] bar

renders a <figure> with a caption, but the wikitext:

Foo [[File:Frisian flag.svg|simple caption]] bar

renders an <a><img> with no caption. MediaWiki's PHP parser renders the caption as the title attribute of the <a>. If the caption of an inline image contains wikitext, it's distilled down to plain text. For instance, try [[File:Frisian flag.svg|'''rich''' [[text]] in <table><tr><td>the</td><td>caption</td></tr></table>]] for instance.

For non-inline images, Parsoid behaves totally correctly, including the rendering of captions containing wikitext.
Comment 1 Gabriel Wicke 2013-01-22 20:35:31 UTC
Just setting the title attribute should be relatively straightforward (using tokensToString()). Making it editable in a way that handles non-text original content will need some thought though. Maybe HTML in an attribute, which we considered elsewhere?
Comment 2 Gabriel Wicke 2013-01-22 20:48:50 UTC
Since this is pretty rare, we should probably simply shadow the plain-text attribute and support plain-text editing only. This would still preserve non-text captions when they are not edited, but will convert to plain-text caption with the first edit.
Comment 3 Gabriel Wicke 2013-06-05 20:14:15 UTC
We are exposing the caption as editable HTML in data-mw. The title attribute for viewing can be set from that in a post-processing step. Please reopen if there are still issues with inline captions.
Comment 4 Andre Klapper 2013-07-04 10:34:11 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

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


Navigation
Links