Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/70233
Change subject: Don't set rel="mw:thumb" on the <a> inside a block image
......................................................................
Don't set rel="mw:thumb" on the <a> inside a block image
Causes DOM diffs
Change-Id: I54bd90cfcbdff4baa06f67cbeb2865dca357be19
---
M modules/ve/dm/nodes/ve.dm.MWBlockImageNode.js
M modules/ve/test/dm/ve.dm.example.js
2 files changed, 2 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/33/70233/1
diff --git a/modules/ve/dm/nodes/ve.dm.MWBlockImageNode.js
b/modules/ve/dm/nodes/ve.dm.MWBlockImageNode.js
index 3e43fa0..15e4228 100644
--- a/modules/ve/dm/nodes/ve.dm.MWBlockImageNode.js
+++ b/modules/ve/dm/nodes/ve.dm.MWBlockImageNode.js
@@ -150,7 +150,6 @@
break;
}
- a.setAttribute( 'rel', 'mw:thumb' );
a.setAttribute( 'href', dataElement.attributes.href );
img.setAttribute( 'src', dataElement.attributes.src );
img.setAttribute( 'width', dataElement.attributes.width );
diff --git a/modules/ve/test/dm/ve.dm.example.js
b/modules/ve/test/dm/ve.dm.example.js
index bcb1336..3bdfc21 100644
--- a/modules/ve/test/dm/ve.dm.example.js
+++ b/modules/ve/test/dm/ve.dm.example.js
@@ -3388,7 +3388,7 @@
]
},
'thumb image': {
- 'html': '<body><figure typeof="mw:Image/Thumb"><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"><a
href="Foo"><img src="Bar" width="1" height="2"
resource="FooBar"></a><figcaption
class="mw-figcaption">abc</figcaption></figure></body>',
'data': [
{
'type': 'mwBlockImage',
@@ -3413,7 +3413,7 @@
]
},
'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',
--
To view, visit https://gerrit.wikimedia.org/r/70233
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I54bd90cfcbdff4baa06f67cbeb2865dca357be19
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits