jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361038 )

Change subject: BlueSpiceVisualEditor: fixed issue with image links
......................................................................


BlueSpiceVisualEditor: fixed issue with image links

When a image link had no value, like [[File:Image.png|link=]], in some
browsers the html parsing breaks, resulting in a merge with the
subsequent HTML element. This can be resolved by adding a blank before
the closing attribute quotation mark.

This fixes ERM 6209

Change-Id: I1d8d00adf4e28d604fa302824707e3a0902c0d09
---
M VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Robert Vogel: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js 
b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
index f429b16..e0d2e50 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
@@ -324,7 +324,13 @@
                //Let's store the original WikiText as well. This makes it 
easier for
                //other extensions to read in the data.
                //We can not use [[/]] because this might cause double parsing!
-               htmlImageObject.attr('data-bs-wikitext', link);
+               // In rare cases, the last section of the wikitext ends with an 
=. This
+               // breaks HTML parsing in some Browsers. So in these cases we 
have to
+               // add a blank. Typical cases are |link= when embedding an image
+               if ( link.match( /=$/ ) ) {
+                       link = link + ' ';
+               }
+               htmlImageObject.attr( 'data-bs-wikitext', link );
 
                //We set a dummy url which contains the original filename as
                //querystring parameter

-- 
To view, visit https://gerrit.wikimedia.org/r/361038
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d8d00adf4e28d604fa302824707e3a0902c0d09
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com>
Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to