https://bugzilla.wikimedia.org/show_bug.cgi?id=66749

            Bug ID: 66749
           Summary: Parsoid outputs <figure> inside of <b>
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
       Web browser: ---
   Mobile Platform: ---

Wikitext: '''foo[[File:Image.jpg|thumb]]bar'''

Resulting DOM: <body><b><figure><a><img /></a></figure>bar</b>

Block nodes like figure aren't supposed to occur inside of inline-ish
(annotation) tags like b. When confronted with this, VisualEditor alienates the
image to preserve its sanity (data model consistency), so bolded images can't
be edited in VE.

Reported by mattk_ on IRC.

$ echo "'''foo[[File:Image.jpg|thumb]]bar'''" | node tests/parse.js

<!DOCTYPE html>
<html prefix="dc: http://purl.org/dc/terms/ mw:
http://mediawiki.org/rdf/";><head prefix="mwr:
http://en.wikipedia.org/wiki/Special:Redirect/";><meta
property="mw:parsoidVersion" content="0"/><link rel="dc:isVersionOf"
href="//en.wikipedia.org/wiki/Main_Page"/><title></title><base
href="//en.wikipedia.org/wiki/Main_Page"/><link rel="stylesheet"
href="//en.wikipedia.org/w/load.php?modules=mediawiki.skinning.elements|mediawiki.skinning.content|mediawiki.skinning.interface|skins.vector.styles|site|mediawiki.skinning.content.parsoid&amp;only=styles&amp;debug=true&amp;skin=vector"/></head><body
data-parsoid='{"dsr":[0,37,0,0]}' lang="en" class="mw-content-ltr
mw-body-content" dir="ltr"><b data-parsoid='{"dsr":[0,36,3,3]}'>foo<figure
class="mw-default-size" typeof="mw:Image/Thumb"
data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"}],"dsr":[6,30,2,2]}'><a
href="./File:Image.jpg"
data-parsoid='{"a":{"href":"./File:Image.jpg"},"sa":{},"dsr":[8,28,null,null]}'><img
resource="./File:Image.jpg"
src="//upload.wikimedia.org/wikipedia/en/thumb/7/78/Image.jpg/220px-Image.jpg"
height="30" width="220"
data-parsoid='{"a":{"resource":"./File:Image.jpg","height":"30","width":"220"},"sa":{"resource":"File:Image.jpg"}}'/></a></figure>bar</b>
</body></html>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to