Rename inner writer

This commit is contained in:
Sauli Anto 2020-10-10 13:27:54 +03:00
parent 2ab10594bb
commit 4323e66ae9

View File

@ -103,15 +103,15 @@ export default class AutoMath extends Plugin {
insertPosition = this._positionToInsert;
}
editor.model.change( writer => {
editor.model.change( innerWriter => {
const params = Object.assign( extractDelimiters( text ), {
type: mathConfig.outputType
} );
const mathElement = writer.createElement( params.display ? 'mathtex-display' : 'mathtex-inline', params );
const mathElement = innerWriter.createElement( params.display ? 'mathtex-display' : 'mathtex-inline', params );
editor.model.insertContent( mathElement, insertPosition );
writer.setSelection( mathElement, 'on' );
innerWriter.setSelection( mathElement, 'on' );
} );
this._positionToInsert.detach();