Mglaser has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404772 )

Change subject: VisualEditor: Fix for <> in tables - commit 2
......................................................................

VisualEditor: Fix for <> in tables - commit 2

Using < and > in tables caused corrupted code
Please see ERM ticket for more info

ERM: #7033

Needs cherry-picking to REL1_23

Change-Id: I638e74dcbd7368ddb6dcf13841dad34b53ee9e94
---
M VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/72/404772/1

diff --git a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js 
b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
index 8362b07..9df13f2 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
@@ -818,8 +818,8 @@
 
                // images or links in tables may contain | in their attributes, 
esp. in bs-data-*. These
                // need to be properly escaped in order not to interfere with 
table syntax
-               while (text.match(/(\<[^\>]*?)(\|)([^\>]*?\>)/g)) {
-                       text = text.replace(/(\<[^\>]*?)(\|)([^\>]*?\>)/g, 
"$1@@pipe@@$3");
+               while 
(text.match(/(\<[^\>]*?)(\"[^\>\"]*?)(\|)([^\>\"]*\")([^\>]*?\>)/g)) {
+                       text = 
text.replace(/(\<[^\>]*?)(\"[^\>\"]*?)(\|)([^\>\"]*\")([^\>]*?\>)/g, 
"$1$2@@pipe@@$4$5");
                }
 
                lines = text.split(/\n/);
@@ -2320,8 +2320,8 @@
                //special tags before pres prevents spaces in special tags like 
GeSHi to take effect
                text = _preserveSpecialTags(text);
 
-               //cleanup linebreaks in tags except comments
-               text = text.replace(/(<[^!][^>]+?)(\n)([^<]+?>)/gi, "$1$3");
+               //cleanup linebreaks in tags except comments and tables
+               text = text.replace(/(<[^!][^>]+?)(\n)([^<|]+?>)/gi, "$1$3");
 
                //preserve entities that were orignially html entities
                text = text.replace(/(&[^\s;]+;)/gmi, '<span 
class="bs_htmlentity">$1</span>');

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I638e74dcbd7368ddb6dcf13841dad34b53ee9e94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27_dev
Gerrit-Owner: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: ItSpiderman <d.savulje...@gmail.com>

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

Reply via email to