add HTMLAttributes to defaultoptions
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
import {
|
||||
Command, createMark, markInputRule, markPasteRule,
|
||||
Command,
|
||||
createMark,
|
||||
markInputRule,
|
||||
markPasteRule,
|
||||
} from '@tiptap/core'
|
||||
|
||||
export interface ItalicOptions {
|
||||
HTMLAttributes: {
|
||||
[key: string]: any
|
||||
},
|
||||
}
|
||||
|
||||
export const starInputRegex = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm
|
||||
export const starPasteRegex = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm
|
||||
export const underscoreInputRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm
|
||||
@@ -10,6 +19,10 @@ export const underscorePasteRegex = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm
|
||||
const Italic = createMark({
|
||||
name: 'italic',
|
||||
|
||||
defaultOptions: <ItalicOptions>{
|
||||
HTMLAttributes: {},
|
||||
},
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user