add basic text style mark
This commit is contained in:
25
packages/extension-text-style/index.ts
Normal file
25
packages/extension-text-style/index.ts
Normal 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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user