diff --git a/shared/editor/nodes/Math.ts b/shared/editor/nodes/Math.ts index b9183f33a8..83c0911e57 100644 --- a/shared/editor/nodes/Math.ts +++ b/shared/editor/nodes/Math.ts @@ -69,9 +69,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() { diff --git a/shared/editor/nodes/MathBlock.ts b/shared/editor/nodes/MathBlock.ts index fe1b618f68..3ffbfd5d17 100644 --- a/shared/editor/nodes/MathBlock.ts +++ b/shared/editor/nodes/MathBlock.ts @@ -41,10 +41,10 @@ export default class MathBlock extends Node { } toMarkdown(state: MarkdownSerializerState, node: ProsemirrorNode) { - state.write("$$$\n"); + state.write("$$\n"); state.text(node.textContent, false); state.ensureNewLine(); - state.write("$$$"); + state.write("$$"); state.closeBlock(node); } diff --git a/shared/editor/rules/math.ts b/shared/editor/rules/math.ts index 48717645cf..f18191d6be 100644 --- a/shared/editor/rules/math.ts +++ b/shared/editor/rules/math.ts @@ -6,8 +6,8 @@ export const REGEX_INLINE_MATH_DOLLARS = /\$\$(.+)\$\$/; export const REGEX_BLOCK_MATH_DOLLARS = /\$\$\$\s+$/; -const inlineMathDelimiter = "$$"; -const blockMathDelimiter = "$$$"; +const inlineMathDelimiter = "$"; +const blockMathDelimiter = "$$"; // test if potential opening or closing delimiter // assumes that there is a "$" at state.src[pos] @@ -85,7 +85,7 @@ function mathInline(state: StateInline, silent: boolean): boolean { return true; } - // check if we have empty content (ex. $$$$) do not parse + // check if we have empty content (ex. $$) do not parse if (match - start === 0) { if (!silent) { state.pending += inlineMathDelimiter + inlineMathDelimiter;