Fix writer and seperate schema

This commit is contained in:
Sauli Anto
2020-08-29 17:33:41 +03:00
parent 0ef44427ce
commit 7d0cd0187f
10 changed files with 101 additions and 88 deletions

View File

@@ -68,7 +68,7 @@ export default class AutoMath extends Plugin {
// Get equation text
for ( const node of walker ) {
if ( node.item.is( 'textProxy' ) ) {
if ( node.item.is( '$textProxy' ) ) {
text += node.item.data;
}
}
@@ -107,7 +107,7 @@ export default class AutoMath extends Plugin {
const params = Object.assign( extractDelimiters( text ), {
type: mathConfig.outputType
} );
const mathElement = writer.createElement( 'mathtex', params );
const mathElement = writer.createElement( params.display ? 'mathtex-display' : 'mathtex-inline', params );
editor.model.insertContent( mathElement, insertPosition );