Last modified: 2014-02-19 23:00: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 T51942, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49942 - Images: wikitext tables inside image captions are lost
Images: wikitext tables inside image captions are lost
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High major
: ---
Assigned To: C. Scott Ananian
https://hu.wikipedia.org/wiki/Vall%C3...
:
Depends on: 52567
Blocks: 54844
  Show dependency treegraph
 
Reported: 2013-06-21 07:18 UTC by Tisza Gergő
Modified: 2014-02-19 23:00 UTC (History)
5 users (show)

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


Attachments

Description Tisza Gergő 2013-06-21 07:18:21 UTC
When editing a page which has an image with table data in its caption, the table is dropped (only its closing tab is kept). The rest of the caption is dropped as well.

Test edit: https://hu.wikipedia.org/w/index.php?title=Vall%C3%A1s&diff=13696305&oldid=13696296

You don't need to interact with the image in any way for this to happen, just edit the page, change anything and save.
Comment 1 James Forrester 2013-06-23 15:06:15 UTC
Horrible, relatively-rare case for Parsoid, is the use of wikitext tables inside image captions. Currently, the following wikitext:

[Start]
[[Image:Foo.jpg|thumb|200px|This is an example image thumbnail caption with a table

{|
! Foo !! Bar
|-
| Foo1 || Bar1
|-
| Foo2 || Bar2
|}

… and some more text.]]
[End]

… turns into the following output from Parsoid:

[Start]
<figure typeof="mw:Image/Thumb" data-parsoid="…">
  <a href="./File:Foo.jpg" data-parsoid="…">
    <img resource="./File:Foo.jpg" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/200px-Foo.jpg"
      height="131" width="200" data-parsoid="…">
  </a>
  <figcaption class="mw-figcaption" data-parsoid="…">}

… and some more text.
  </figcaption>
</figure>
[End]

… whereas nominally it should be (generated using an HTML table rather than a wikitext one, which seems to work fine without DOM diffs from VE end):

[Start]
<figure typeof="mw:Image/Thumb" data-parsoid="…">
  <a href="./File:Foo.jpg" data-parsoid="…">
    <img resource="./File:Foo.jpg" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/200px-Foo.jpg"
      height="131" width="200" data-parsoid="…">
  </a>
  <figcaption class="mw-figcaption" data-parsoid="…">This is an example image thumbnail caption with a table

    <table data-parsoid="…">
      <tbody data-parsoid="…">
        <tr data-parsoid="…">
          <th data-parsoid="…">Foo</th>
           <th data-parsoid="…">Bar</th>
        </tr>
        <tr data-parsoid="…">
          <td data-parsoid="…">Foo1</td>
          <td data-parsoid="…">Bar1</td>
        </tr>
        <tr data-parsoid="…">
          <td data-parsoid="…">Foo2</td>
          <td data-parsoid="…">Bar2</td>
        </tr>
      </tbody>
    </table>

… and some more text.
  </figcaption>
</figure>
[End]
Comment 2 Gabriel Wicke 2013-06-24 20:21:34 UTC
This is a tokenizer issue. The table is not tokenized as such, likely because syntax stops prevent a pipe from being matched.

If this image is not modified by the user it should still round-trip correctly, but on modification the table would be lost.
Comment 3 Tisza Gergő 2013-06-24 22:47:42 UTC
(In reply to comment #2)
> If this image is not modified by the user it should still round-trip
> correctly,
> but on modification the table would be lost.

The table is lost even if the user does not interact with the image in any way. See [[hu:Vallás]] - the image caption gets garbled as soon as you open the article for editing.
Comment 4 James Forrester 2013-06-24 22:56:26 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > If this image is not modified by the user it should still round-trip
> > correctly,
> > but on modification the table would be lost.
> 
> The table is lost even if the user does not interact with the image in any
> way.
>
> See [[hu:Vallás]] - the image caption gets garbled as soon as you open the
> article for editing.

The corruption even if you don't touch it is a bug in VisualEditor related to munging the captions of images, which we're fixing today; sorry for that.
Comment 5 Andre Klapper 2013-07-04 10:34:44 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]
Comment 6 Gerrit Notification Bot 2014-01-13 16:41:46 UTC
Change 107172 had a related patch set uploaded by Subramanya Sastry:
(Bug 49942) Tables can show up in captions

https://gerrit.wikimedia.org/r/107172
Comment 7 Gerrit Notification Bot 2014-01-13 21:05:13 UTC
Change 107172 merged by Subramanya Sastry:
(Bug 49942) Tables can show up in image captions

https://gerrit.wikimedia.org/r/107172

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


Navigation
Links