mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-11 21:12:02 +10:00
fix: allow space in inline math (#508)
This commit is contained in:
@ -38,7 +38,7 @@ export default function MathInlineView(props: NodeViewProps) {
|
|||||||
renderMath(preview || "", mathPreviewContainer.current);
|
renderMath(preview || "", mathPreviewContainer.current);
|
||||||
} else if (preview !== null) {
|
} else if (preview !== null) {
|
||||||
queueMicrotask(() => {
|
queueMicrotask(() => {
|
||||||
updateAttributes({ text: preview });
|
updateAttributes({ text: preview.trim() });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [preview, isEditing]);
|
}, [preview, isEditing]);
|
||||||
@ -97,7 +97,7 @@ export default function MathInlineView(props: NodeViewProps) {
|
|||||||
ref={textAreaRef}
|
ref={textAreaRef}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
classNames={{ input: classes.textInput }}
|
classNames={{ input: classes.textInput }}
|
||||||
value={preview?.trim() ?? ""}
|
value={preview ?? ""}
|
||||||
placeholder={"E = mc^2"}
|
placeholder={"E = mc^2"}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Escape" || (e.key === "Enter" && !e.shiftKey)) {
|
if (e.key === "Escape" || (e.key === "Enter" && !e.shiftKey)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user