Add engine option

This commit is contained in:
Sauli Anto
2019-09-17 16:19:35 +03:00
parent a89cadeac5
commit dbaaa96ae9
6 changed files with 23 additions and 15 deletions

View File

@@ -37,7 +37,9 @@ export default class MathEditing extends Plugin {
_defineConverters() {
const conversion = this.editor.conversion;
const mathConfig = this.editor.config.get( 'math' );
// Todo: better checks
const engine = typeof mathConfig !== 'undefined' && typeof mathConfig.engine !== 'undefined' ? mathConfig.engine : 'mathjax';
// View -> Model
conversion.for( 'upcast' )
@@ -120,7 +122,7 @@ export default class MathEditing extends Plugin {
const uiElement = viewWriter.createUIElement( 'div', null, function( domDocument ) {
const domElement = this.toDomElement( domDocument );
renderEquation( equation, domElement, 'mathjax', display );
renderEquation( equation, domElement, engine, display );
return domElement;
} );