diff --git a/prose/markdownParser.js b/prose/markdownParser.js index cbc9b5e..bd81590 100644 --- a/prose/markdownParser.js +++ b/prose/markdownParser.js @@ -3,7 +3,7 @@ import markdownit from "markdown-it"; import { writeFreelySchema } from "./schema"; -export const writeAsMarkdownParser = new MarkdownParser( +export const writeFreelyMarkdownParser = new MarkdownParser( writeFreelySchema, markdownit("commonmark", { html: true }), { diff --git a/prose/markdownSerializer.js b/prose/markdownSerializer.js index cadfcac..d14deab 100644 --- a/prose/markdownSerializer.js +++ b/prose/markdownSerializer.js @@ -26,7 +26,7 @@ function isPlainURL(link, parent, index, side) { return !link.isInSet(next.marks); } -export const writeAsMarkdownSerializer = new MarkdownSerializer( +export const writeFreelyMarkdownSerializer = new MarkdownSerializer( { readmore(state, node) { state.write("\n"); diff --git a/prose/prose.js b/prose/prose.js index 5a6b618..7c361a0 100644 --- a/prose/prose.js +++ b/prose/prose.js @@ -14,8 +14,8 @@ import { EditorState, TextSelection } from "prosemirror-state"; import { exampleSetup } from "prosemirror-example-setup"; import { keymap } from "prosemirror-keymap"; -import { writeAsMarkdownParser } from "./markdownParser"; -import { writeAsMarkdownSerializer } from "./markdownSerializer"; +import { writeFreelyMarkdownParser } from "./markdownParser"; +import { writeFreelyMarkdownSerializer } from "./markdownSerializer"; import { writeFreelySchema } from "./schema"; import { getMenu } from "./menu"; @@ -40,7 +40,7 @@ class ProseMirrorView { $title.value = title; } - const doc = writeAsMarkdownParser.parse( + const doc = writeFreelyMarkdownParser.parse( // Replace all "solo" \n's with \\\n for correct markdown parsing // Can't use lookahead or lookbehind because it's not supported on Safari content.replace(/([^]{0,1})(\n)([^]{0,1})/g, (match, p1, p2, p3) => { @@ -73,7 +73,7 @@ class ProseMirrorView { }), dispatchTransaction(transaction) { let newState = this.state.apply(transaction); - const newContent = writeAsMarkdownSerializer + const newContent = writeFreelyMarkdownSerializer .serialize(newState.doc) // Replace all \\\ns ( not followed by a \n ) with \n .replace(/(\\\n)(\n{0,1})/g, (match, p1, p2) =>