import katex from "katex";
import "katex/dist/katex.min.css";
window.katex = katex;
const modules = {
toolbar: [
["bold", "italic", "underline"], // toggled buttons
// ["blockquote"],
[{ list: "ordered" }, { list: "bullet" }],
[{ script: "sub" }, { script: "super" }], // superscript/subscript
[{ header: [1, 2, 3, false] }],
["image", { formula: { customClass: 'qlformula' } }],
[{ color: [] }, { background: [] }], // dropdown with defaults from theme
[{ align: [] }],
["clean"], // remove formatting button
],
clipboard: {
// toggle to add extra line breaks when pasting HTML:
matchVisual: false,
},
};
<ReactQuill
fullWidth
name="mcqQuestion"
// onChange={handleChange}
onChange={(content, delta, source, editor) => {
const isEmpty = !content.trim().replace(/<[^>]*>/g, '').length;
setFieldValue('mcqQuestion', isEmpty ? '':content);
}}
value={values.mcqQuestion}
error={Boolean(touched.mcqQuestion && errors.mcqQuestion)}
helperText={touched.mcqQuestion && errors.mcqQuestion}
modules={modules}
formats={formats}
bounds={".app"}
style={toolbarStyles}
/>
i want it should return string value when we write mathematical expression, if write any string then its working, issue is happening with only formula
New contributor
Guddu Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.