move extensions to own package
This commit is contained in:
29
packages/tiptap-extensions/src/marks/Code.js
Normal file
29
packages/tiptap-extensions/src/marks/Code.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Mark } from 'tiptap'
|
||||
import { toggleMark } from 'tiptap-commands'
|
||||
|
||||
export default class CodeMark extends Mark {
|
||||
|
||||
get name() {
|
||||
return 'code'
|
||||
}
|
||||
|
||||
get schema() {
|
||||
return {
|
||||
parseDOM: [
|
||||
{ tag: 'code' },
|
||||
],
|
||||
toDOM: () => ['code', 0],
|
||||
}
|
||||
}
|
||||
|
||||
keys({ type }) {
|
||||
return {
|
||||
'Mod-`': toggleMark(type),
|
||||
}
|
||||
}
|
||||
|
||||
command({ type }) {
|
||||
return toggleMark(type)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user