fix: Keyboard navigation around inline code marks (#5477)

This commit is contained in:
Tom Moor
2023-06-26 18:28:42 -04:00
committed by GitHub
parent e001b8d161
commit a2fae1f1eb
6 changed files with 102 additions and 262 deletions

View File

@@ -1,3 +1,4 @@
import codemark from "prosemirror-codemark";
import { toggleMark } from "prosemirror-commands";
import {
MarkSpec,
@@ -8,8 +9,6 @@ import {
} from "prosemirror-model";
import { Plugin } from "prosemirror-state";
import { EditorView } from "prosemirror-view";
import moveLeft from "../commands/moveLeft";
import moveRight from "../commands/moveRight";
import markInputRule from "../lib/markInputRule";
import { MarkdownSerializerState } from "../lib/markdown/serializer";
import Mark from "./Mark";
@@ -57,13 +56,12 @@ export default class Code extends Mark {
// https://github.com/ProseMirror/prosemirror/issues/515
return {
"Mod`": toggleMark(type),
ArrowLeft: moveLeft(),
ArrowRight: moveRight(),
};
}
get plugins() {
return [
...codemark({ markType: this.editor.schema.marks.code_inline }),
new Plugin({
props: {
// Typing a character inside of two backticks will wrap the character