mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
parent
6c194e8ffd
commit
c95ecf504d
@ -12,6 +12,20 @@ export default class MathEditing extends Plugin {
|
|||||||
return 'MathEditing';
|
return 'MathEditing';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor( editor ) {
|
||||||
|
super( editor );
|
||||||
|
editor.config.define( 'math', {
|
||||||
|
engine: 'mathjax',
|
||||||
|
outputType: 'script',
|
||||||
|
className: 'math-tex',
|
||||||
|
forceOutputType: false,
|
||||||
|
enablePreview: true,
|
||||||
|
previewClassName: [],
|
||||||
|
popupClassName: [],
|
||||||
|
katexRenderOptions: {}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
const editor = this.editor;
|
const editor = this.editor;
|
||||||
editor.commands.add( 'math', new MathCommand( editor ) );
|
editor.commands.add( 'math', new MathCommand( editor ) );
|
||||||
@ -23,16 +37,6 @@ export default class MathEditing extends Plugin {
|
|||||||
'viewToModelPosition',
|
'viewToModelPosition',
|
||||||
viewToModelPositionOutsideModelElement( editor.model, viewElement => viewElement.hasClass( 'math' ) )
|
viewToModelPositionOutsideModelElement( editor.model, viewElement => viewElement.hasClass( 'math' ) )
|
||||||
);
|
);
|
||||||
editor.config.define( 'math', {
|
|
||||||
engine: 'mathjax',
|
|
||||||
outputType: 'script',
|
|
||||||
className: 'math-tex',
|
|
||||||
forceOutputType: false,
|
|
||||||
enablePreview: true,
|
|
||||||
previewClassName: [],
|
|
||||||
popupClassName: [],
|
|
||||||
katexRenderOptions: {}
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_defineSchema() {
|
_defineSchema() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user