From e6605706c0387532961283f295818fcb75317c96 Mon Sep 17 00:00:00 2001 From: Sauli Anto Date: Thu, 3 Oct 2019 03:44:28 +0300 Subject: [PATCH] Add preview fix --- README.md | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b1a824f10..7d1d08192 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 be InlineEditor.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 formats Supported input and output formats are: ```html