0.4.2 • Published 2 years ago
@zhyd1997/draftjs-to-latex v0.4.2
draftjs-to-latex
Convert Draftjs content to LaTeX source code.
Features
Block Type | Supported | Block Enum | Notes |
---|---|---|---|
Bold | ✅ Yes | BOLD | |
Italic | ✅ Yes | ITALIC | |
Underline | ✅ Yes | UNDERLINE | |
Inline Code | ✅ Yes | CODE | |
H1 | ✅ Yes | header-one | |
H2 | ✅ Yes | header-two | |
H3 | ✅ Yes | header-three | |
UL | ✅ Yes | unordered-list-item | only support for continuous list |
OL | ✅ Yes | ordered-list-item | only support for continuous list |
Equation | ✅ Yes | MATH | using katex for rendering |
Image | ❌ Missing | ||
Table | ❌ Missing | ||
Code Snippet | ❌ Missing |
Limitations
Not support overlapping styles.
Usage
npm i @zhyd1997/draftjs-to-latex
# yarn
yarn add @zhyd1997/draftjs-to-latex
Only support ES6:
import { scan } from "@zhyd1997/draftjs-to-latex";
const generatedTex = scan(contentState);
// console.log(generatedTex);
Development
npm install
npm test