aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-02-28 13:30:25 -0500
committerbobzel <zzzman@gmail.com>2021-02-28 13:30:25 -0500
commite4641f707946b0b6769bc736b5bae774639e88a7 (patch)
tree1b6779b773bf1abc3b56101b89c455923d8b88da /src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
parent0c33f25e18279a27a62ddfaba36d04dab86a4ca5 (diff)
got rid of link on deselect stuff (not used and should be implemented as text rule). fixe hyperlink terms.
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;
}