Skip to content

Commit 950530b

Browse files
author
Oleksandr Dubovyk
committed
MC-30586: TinyMCE4: some HTML code breaks the editor
- avoided multiple returns
1 parent 5eab194 commit 950530b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,21 @@ define([
168168
/(<span class="[^"]*magento-widget[^"]*"[^>]*>)?<img([^>]+id="[^>]+)>(([^>]*)<\/span>)?/i,
169169
function (match) {
170170
var attributes = wysiwyg.parseAttributesString(match[2]),
171-
widgetCode;
171+
widgetCode,
172+
result = match[0];
172173

173174
if (attributes.id) {
174175
try {
175176
widgetCode = Base64.idDecode(attributes.id);
177+
if (widgetCode && widgetCode.indexOf('{{widget') !== -1) {
178+
result = widgetCode;
179+
}
176180
} catch (e) {
177181
// Ignore and continue.
178182
}
179-
180-
if (widgetCode && widgetCode.indexOf('{{widget') !== -1) {
181-
return widgetCode;
182-
}
183183
}
184184

185-
return match[0];
185+
return result;
186186
}
187187
);
188188
},

0 commit comments

Comments
 (0)