mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-08 12:27:59 +08:00
26 lines
386 B
TypeScript
26 lines
386 B
TypeScript
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,
|
|
}
|
|
}
|