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&only=styles&debug=true&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>
Version: unspecified
Severity: normal