mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Don't set rel="mw:thumb" on the <a> inside a block image
Causes DOM diffs Change-Id: I54bd90cfcbdff4baa06f67cbeb2865dca357be19
This commit is contained in:
parent
1a8bb8c6ab
commit
c48af4de1f
|
@ -158,7 +158,6 @@ ve.dm.MWBlockImageNode.static.toDomElements = function ( data, doc, converter )
|
|||
} else if ( classes.length > 0 ) {
|
||||
figure.className = classes.join( ' ' );
|
||||
}
|
||||
a.setAttribute( 'rel', 'mw:thumb' );
|
||||
a.setAttribute( 'href', dataElement.attributes.href );
|
||||
img.setAttribute( 'src', dataElement.attributes.src );
|
||||
img.setAttribute( 'width', dataElement.attributes.width );
|
||||
|
|
|
@ -3367,7 +3367,7 @@ ve.dm.example.domToDataCases = {
|
|||
]
|
||||
},
|
||||
'thumb image': {
|
||||
'html': '<body><figure typeof="mw:Image/Thumb" class="mw-halign-right"><a rel="mw:thumb" href="Foo"><img src="Bar" width="1" height="2" resource="FooBar"></a><figcaption class="mw-figcaption">abc</figcaption></figure></body>',
|
||||
'html': '<body><figure typeof="mw:Image/Thumb" class="mw-halign-right"><a href="Foo"><img src="Bar" width="1" height="2" resource="FooBar"></a><figcaption class="mw-figcaption">abc</figcaption></figure></body>',
|
||||
'data': [
|
||||
{
|
||||
'type': 'mwBlockImage',
|
||||
|
@ -3393,7 +3393,7 @@ ve.dm.example.domToDataCases = {
|
|||
]
|
||||
},
|
||||
'attribute preservation does not crash due to text node split': {
|
||||
'html': '<body><figure typeof="mw:Image/Thumb" data-parsoid="{}"><a rel="mw:thumb" href="Foo" data-parsoid="{}"><img src="Bar" width="1" height="2" resource="FooBar" data-parsoid="{}"></a><figcaption class="mw-figcaption" data-parsoid="{}"> foo <a rel="mw:WikiLink" href="./Bar" data-parsoid="{}">bar</a> baz</figcaption></figure></body>',
|
||||
'html': '<body><figure typeof="mw:Image/Thumb" data-parsoid="{}"><a href="Foo" data-parsoid="{}"><img src="Bar" width="1" height="2" resource="FooBar" data-parsoid="{}"></a><figcaption class="mw-figcaption" data-parsoid="{}"> foo <a rel="mw:WikiLink" href="./Bar" data-parsoid="{}">bar</a> baz</figcaption></figure></body>',
|
||||
'data': [
|
||||
{
|
||||
'type': 'mwBlockImage',
|
||||
|
|
Loading…
Reference in a new issue