add HTMLAttributes to defaultoptions

This commit is contained in:
Philipp Kühn
2020-11-13 16:44:22 +01:00
parent c840a562de
commit 2591ffe419
18 changed files with 173 additions and 26 deletions

View File

@@ -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 [
{