Skip to content

Commit c32651b

Browse files
author
Piotr Jasiun
committed
Merge branch 't/11777'
2 parents 6db706a + 60ebc0b commit c32651b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Fixed Issues:
3131
* [#11793](http://dev.ckeditor.com/ticket/11793): Fixed: Drop down is not "on" when clicking it while editor is blurred.
3232
* [#11850](http://dev.ckeditor.com/ticket/11850): Fixed: Filter downcasting fake object to element it replaced is not applied if fake object element is non-editable.
3333
* [#11811](http://dev.ckeditor.com/ticket/11811): Fixed: Widget's data are not encoded correctly when passed to attribute.
34+
* [#11777](http://dev.ckeditor.com/ticket/11777): Fixed encoding ampersand in the [Mathematical Formulas](http://ckeditor.com/addon/mathjax) plugin.
3435

3536
Other changes:
3637

plugins/mathjax/plugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
if ( el.children.length > 1 || el.children[ 0 ].type != CKEDITOR.NODE_TEXT )
9292
return;
9393

94-
data.math = el.children[ 0 ].value;
94+
data.math = CKEDITOR.tools.htmlDecode( el.children[ 0 ].value );
9595

9696
// Add style display:inline-block to have proper height of widget wrapper and mask.
9797
var attrs = el.attributes;
@@ -110,7 +110,7 @@
110110
},
111111

112112
downcast: function( el ) {
113-
el.children[ 0 ].replaceWith( new CKEDITOR.htmlParser.text( this.data.math ) );
113+
el.children[ 0 ].replaceWith( new CKEDITOR.htmlParser.text( CKEDITOR.tools.htmlEncode( this.data.math ) ) );
114114

115115
// Remove style display:inline-block.
116116
var attrs = el.attributes;
@@ -384,7 +384,7 @@
384384
* @param {String} value TeX string.
385385
*/
386386
setValue: function( value ) {
387-
newValue = value;
387+
newValue = CKEDITOR.tools.htmlEncode( value );
388388

389389
if ( isInit && !isRunning )
390390
update();
@@ -410,7 +410,7 @@
410410
var doc = iFrame.getFrameDocument(),
411411
tex = doc.getById( 'tex' );
412412

413-
tex.setHtml( CKEDITOR.plugins.mathjax.trim( value ) );
413+
tex.setHtml( CKEDITOR.plugins.mathjax.trim( CKEDITOR.tools.htmlEncode( value ) ) );
414414

415415
CKEDITOR.plugins.mathjax.copyStyles( iFrame, tex );
416416

0 commit comments

Comments
 (0)