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