Skip to content

Commit

Permalink
Merge branch 't/11777'
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed May 13, 2014
2 parents 6db706a + 60ebc0b commit c32651b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -31,6 +31,7 @@ Fixed Issues:
* [#11793](http://dev.ckeditor.com/ticket/11793): Fixed: Drop down is not "on" when clicking it while editor is blurred.
* [#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.
* [#11811](http://dev.ckeditor.com/ticket/11811): Fixed: Widget's data are not encoded correctly when passed to attribute.
* [#11777](http://dev.ckeditor.com/ticket/11777): Fixed encoding ampersand in the [Mathematical Formulas](http://ckeditor.com/addon/mathjax) plugin.

Other changes:

Expand Down
8 changes: 4 additions & 4 deletions plugins/mathjax/plugin.js
Expand Up @@ -91,7 +91,7 @@
if ( el.children.length > 1 || el.children[ 0 ].type != CKEDITOR.NODE_TEXT )
return;

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

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

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

// Remove style display:inline-block.
var attrs = el.attributes;
Expand Down Expand Up @@ -384,7 +384,7 @@
* @param {String} value TeX string.
*/
setValue: function( value ) {
newValue = value;
newValue = CKEDITOR.tools.htmlEncode( value );

if ( isInit && !isRunning )
update();
Expand All @@ -410,7 +410,7 @@
var doc = iFrame.getFrameDocument(),
tex = doc.getById( 'tex' );

tex.setHtml( CKEDITOR.plugins.mathjax.trim( value ) );
tex.setHtml( CKEDITOR.plugins.mathjax.trim( CKEDITOR.tools.htmlEncode( value ) ) );

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

Expand Down

0 comments on commit c32651b

Please sign in to comment.