diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-09-09 23:17:50 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-09-09 23:17:50 -0400 |
commit | a1e08c0be1a1067232ea71ed3344ce44d9522bf7 (patch) | |
tree | bc4e7f2761cf02d5728904a46c3bbf27fe7e95c4 /src/client/util/ProsemirrorExampleTransfer.ts | |
parent | a8be7ef95403a1f4559aeff9695e67ad2030e3b9 (diff) |
added center alignment for text using ^^
Diffstat (limited to 'src/client/util/ProsemirrorExampleTransfer.ts')
-rw-r--r-- | src/client/util/ProsemirrorExampleTransfer.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/client/util/ProsemirrorExampleTransfer.ts b/src/client/util/ProsemirrorExampleTransfer.ts index cc2ae7d38..bac0177ad 100644 --- a/src/client/util/ProsemirrorExampleTransfer.ts +++ b/src/client/util/ProsemirrorExampleTransfer.ts @@ -52,18 +52,18 @@ export default function buildKeymap<S extends Schema<any>>(schema: S, mapKeys?: bind("Ctrl->", wrapIn(schema.nodes.blockquote)); - bind("^", (state: EditorState<S>, dispatch: (tx: Transaction<S>) => void) => { - let newNode = schema.nodes.footnote.create({}); - if (dispatch && state.selection.from === state.selection.to) { - let tr = state.tr; - tr.replaceSelectionWith(newNode); // replace insertion with a footnote. - dispatch(tr.setSelection(new NodeSelection( // select the footnote node to open its display - tr.doc.resolve( // get the location of the footnote node by subtracting the nodesize of the footnote from the current insertion point anchor (which will be immediately after the footnote node) - tr.selection.anchor - tr.selection.$anchor.nodeBefore!.nodeSize)))); - return true; - } - return false; - }); + // bind("^", (state: EditorState<S>, dispatch: (tx: Transaction<S>) => void) => { + // let newNode = schema.nodes.footnote.create({}); + // if (dispatch && state.selection.from === state.selection.to) { + // let tr = state.tr; + // tr.replaceSelectionWith(newNode); // replace insertion with a footnote. + // dispatch(tr.setSelection(new NodeSelection( // select the footnote node to open its display + // tr.doc.resolve( // get the location of the footnote node by subtracting the nodesize of the footnote from the current insertion point anchor (which will be immediately after the footnote node) + // tr.selection.anchor - tr.selection.$anchor.nodeBefore!.nodeSize)))); + // return true; + // } + // return false; + // }); let cmd = chainCommands(exitCode, (state, dispatch) => { |