fix: Ctrl-a/e in code fences

This commit is contained in:
Tom Moor
2023-04-16 09:49:19 -04:00
parent aa04a5e6f4
commit f2b3524d87
3 changed files with 141 additions and 41 deletions

View File

@@ -2,6 +2,13 @@ import { NodeType } from "prosemirror-model";
import { EditorState } from "prosemirror-state";
import { Dispatch } from "../types";
/**
* Converts the current node to a paragraph when pressing backspace at the
* beginning of the node and not already a paragraph.
*
* @param type The node type
* @returns A prosemirror command.
*/
export default function backspaceToParagraph(type: NodeType) {
return (state: EditorState, dispatch: Dispatch) => {
const { $from, from, to, empty } = state.selection;