add basic text style mark

This commit is contained in:
Philipp Kühn
2020-11-06 14:46:59 +01:00
parent bdb90403eb
commit d6930a6ba6
5 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { createMark } from '@tiptap/core'
const TextStyle = createMark({
name: 'textStyle',
parseHTML() {
return [
{
tag: 'span',
},
]
},
renderHTML({ attributes }) {
return ['span', attributes, 0]
},
})
export default TextStyle
declare module '@tiptap/core/src/Editor' {
interface AllExtensions {
TextStyle: typeof TextStyle,
}
}