mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 11:45:15 +08:00
30 lines
395 B
JavaScript
30 lines
395 B
JavaScript
import { Mark } from 'vue-mirror/utils'
|
|
import { toggleMark } from 'vue-mirror/helpers'
|
|
|
|
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)
|
|
}
|
|
|
|
}
|