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
Add preview fix
Sauli Antoe6605706c038
diff --git a/README.md b/README.mdindex b1a824f100..7d1d081928 100644--- a/README.md+++ b/README.md@@ -34,12 +34,6 @@ InlineEditor.defaultConfig = {// ...'math']- },- // ...- math: {- engine: 'mathjax',- outputType: 'script',- forceOutputType: false}};```@@ -52,6 +46,19 @@ Styles requires PostCSS like offical CKEditor plugins.## Configuration & Usage+### Plugin options+```js+InlineEditor.defaultConfig = {+ // ...+ math: {+ engine: 'mathjax', // or katex or function (equation, element, display) => { ... }+ outputType: 'script', // or span or math+ forceOutputType: false, // forces output to use outputType+ enablePreview: true // Enable preview view+ }+}+```+### Available typesetting engines__MathJax__- Tested by using version __2.7.5__ and __TeX-MML-AM_HTMLorMML__ configuration. It has also experimental (__CHTML__, __SVG__) support for __3.0.0__ or newer version.@@ -67,7 +74,7 @@ It's possible to implement with engine config. For example, this feature can beInlineEditor.defaultConfig = {// ...math: {- engine: (equation, element, display) => {+ engine: (equation, element, display, previewHack) => {// ...}}@@ -76,20 +83,9 @@ InlineEditor.defaultConfig = {- __equation__ is equation in TeX format without delimiters.- __element__ is DOM element reserved for rendering.- __display__ is boolean. Typesetting should be inline when false.+- __previewHack__ is boolean. Enable preview hack when true. It adds equation element to end of the body and use absolute position.-### Plugin options-```js-InlineEditor.defaultConfig = {- // ...- math: {- engine: 'mathjax', // or katex or function (equation, element, display) => { ... }- outputType: 'script', // or span or math- forceOutputType: false // forces output to use outputType- }-}-```-### Supported input and output formatsSupported input and output formats are:```html