From e76cfe8b4237fe8380cfd12861119a19e9b532ef Mon Sep 17 00:00:00 2001 From: Jim Graham Date: Thu, 7 Sep 2017 01:43:12 -0400 Subject: [PATCH] Change onCleanup regex The current regex only fixes the last ampersand within modx tags with multiple properties being set. This takes a different approach, not attempting to focus in on content within opening/closing double brackets but rather on the parameter format itself (which is highly unlikely to be used in normal text). This would also allow for ampersands within nested tags to be easily converted too, sidestepping the need for an overly-complex regex. --- assets/components/tinymce/tiny.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/components/tinymce/tiny.js b/assets/components/tinymce/tiny.js index 5dbcc22..b0e6be7 100644 --- a/assets/components/tinymce/tiny.js +++ b/assets/components/tinymce/tiny.js @@ -92,8 +92,8 @@ var Tiny = { switch (type) { case "get_from_editor": case "insert_to_editor": - var regexp = /(\[\[[^\]]*)&([^\[]*\]\])/g; - value = value.replace(regexp,'$1&$2'); + var regexp = /&([^=`]*=`[^`]*`)/g; + value = value.replace(regexp,'&$1'); break; case "submit_content": //value.innerHTML = value.innerHTML.replace('&','&'); @@ -268,4 +268,4 @@ Ext.extend(Tiny.button.Image,Ext.Button,{ } }); Ext.reg('tiny-btn-image',Tiny.button.Image); -*/ \ No newline at end of file +*/