Add preview fix

This commit is contained in:
Sauli Anto
2019-10-03 03:44:28 +03:00
parent 2e94edf4f3
commit e6605706c0

View File

@@ -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