Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
#81 Make span element className configurable
Daniel Kulbec7b616a31d93
diff --git a/README.md b/README.mdindex 707d90e1d6..3d1f3be55e 100644--- a/README.md+++ b/README.md@@ -132,6 +132,7 @@ InlineEditor.defaultConfig = {engine: 'mathjax', // or katex or function. E.g. (equation, element, display) => { ... }lazyLoad: undefined, // async () => { ... }, called once before rendering first equation if engine doesn't exist. After resolving promise, plugin renders equations.outputType: 'script', // or span+ className: 'math-tex', // class name to use with span output type, change e.g. MathJax processClass (v2) / processHtmlClass (v3) is setforceOutputType: false, // forces output to use outputTypeenablePreview: true, // Enable preview viewpreviewClassName: [], // Class names to add to previewsdiff --git a/src/mathediting.js b/src/mathediting.jsindex 1268e3c600..5a4a1973ac 100644--- a/src/mathediting.js+++ b/src/mathediting.js@@ -26,6 +26,7 @@ export default class MathEditing extends Plugin {editor.config.define( 'math', {engine: 'mathjax',outputType: 'script',+ className: 'math-tex',forceOutputType: false,enablePreview: true,previewClassName: [],@@ -95,7 +96,7 @@ export default class MathEditing extends Plugin {.elementToElement( {view: {name: 'span',- classes: [ 'math-tex' ]+ classes: [ mathConfig.className ]},model: ( viewElement, { writer } ) => {const equation = viewElement.getChild( 0 ).data.trim();@@ -185,7 +186,7 @@ export default class MathEditing extends Plugin {if ( type === 'span' ) {const mathtexView = writer.createContainerElement( 'span', {- class: 'math-tex'+ class: mathConfig.className} );if ( display ) {