Estoy usando el paquete draft-js-latex-plugin para implementar Tex en mi editor Draft-JS . La documentación del paquete dice lo siguiente:
Presione $ para iniciar Inline TeX Presione CMD + M para iniciar Tex Block Para escribir el carácter $, escriba $
Ahora, cuando presiono $, aparece un espacio vacío en lugar de texto en línea (a veces ocurre, a veces no, al azar).
El problema es cambiar ese espacio vacío al componente inline-tex.
Así es como implementé el complemento (evité el resto del código):
... import { getLaTeXPlugin } from "draft-js-latex-plugin"; import "draft-js-latex-plugin/lib/styles.css"; import "katex/dist/katex.min.css"; const DraftEditor = props => { ... const LaTeXPlugin = getLaTeXPlugin(); const plugins = [LaTeXPlugin]; return <Editor customStyleMap={highlightStyleMap} ref={editorRef} handleKeyCommand={handleKeyCommand} editorState={editorState} onChange={changeHandler} plugins={plugins} /> }