mirror of
https://github.com/outline/outline.git
synced 2026-11-25 07:04:37 +03:00
fix: Adjust math delimiter to fix markdown import/export compatibility issue (#6727)
#6650)
This commit is contained in:
3 files changed
+7
-7
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user