fix: Impossible to type more than one dollar symbol in a paragraph without triggering LaTeX (#5061)

This commit is contained in:
Tom Moor
2023-03-19 14:37:17 -04:00
committed by GitHub
parent 39eac5c6a6
commit 827c912887
3 changed files with 10 additions and 8 deletions

View File

@@ -2,7 +2,6 @@ import {
mathBackspaceCmd,
insertMathCmd,
makeInlineMathInputRule,
REGEX_INLINE_MATH_DOLLARS,
mathSchemaSpec,
} from "@benrbray/prosemirror-math";
import { PluginSimple } from "markdown-it";
@@ -21,7 +20,7 @@ import {
import { EditorState, Plugin } from "prosemirror-state";
import { MarkdownSerializerState } from "../lib/markdown/serializer";
import MathPlugin from "../plugins/Math";
import mathRule from "../rules/math";
import mathRule, { REGEX_INLINE_MATH_DOLLARS } from "../rules/math";
import { Dispatch } from "../types";
import Node from "./Node";
@@ -71,9 +70,9 @@ export default class Math extends Node {
}
toMarkdown(state: MarkdownSerializerState, node: ProsemirrorNode) {
state.write("$");
state.write("$$");
state.text(node.textContent, false);
state.write("$");
state.write("$$");
}
parseMarkdown() {