aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts')
-rw-r--r--src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
index 243cfc6de..a1a404e10 100644
--- a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
+++ b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
@@ -255,36 +255,6 @@ export function buildKeymap<S extends Schema<any>>(schema: S, props: any, mapKey
// bind("Mod-Enter", cmd);
bind("Shift-Enter", cmd);
-
- bind(":", (state: EditorState<S>, dispatch: (tx: Transaction<S>) => void) => {
- const range = state.selection.$from.blockRange(state.selection.$to, (node: any) => {
- return !node.marks || !node.marks.find((m: any) => m.type === schema.marks.metadata);
- });
-
- const path = (state.doc.resolve(state.selection.from - 1) as any).path;
-
- const spaceSeparator = path[path.length - 3].childCount > 1 ? 0 : -1;
-
- const anchor = range!.end - path[path.length - 3].lastChild.nodeSize + spaceSeparator;
-
- if (anchor >= 0) {
-
- const textsel = TextSelection.create(state.doc, anchor, range!.end);
-
- const text = range ? state.doc.textBetween(textsel.from, textsel.to) : "";
-
- let whitespace = text.length - 1;
-
- for (; whitespace >= 0 && text[whitespace] !== " "; whitespace--) { }
- if (text.endsWith(":")) {
- dispatch(state.tr.addMark(textsel.from + whitespace + 1, textsel.to, schema.marks.metadata.create() as any).
- addMark(textsel.from + whitespace + 1, textsel.to - 2, schema.marks.metadataKey.create() as any));
- }
- }
-
- return false;
- });
-
return keys;
}