fix some bugs

This commit is contained in:
Philipp Kühn
2020-11-06 00:13:18 +01:00
parent e4eed4ea09
commit dc62ac1326
5 changed files with 28 additions and 23 deletions

View File

@@ -2,10 +2,6 @@ import {
Command, createMark, markInputRule, markPasteRule,
} from '@tiptap/core'
export interface HighlightOptions {
color: string,
}
export const inputRegex = /(?:^|\s)((?:==)((?:[^~]+))(?:==))$/gm
export const pasteRegex = /(?:^|\s)((?:==)((?:[^~]+))(?:==))/gm
@@ -54,8 +50,8 @@ const Highlight = createMark({
addCommands() {
return {
highlight: (attrs?: HighlightOptions): Command => ({ commands }) => {
return commands.toggleMark('highlight', attrs)
highlight: (attributes?: { color: string }): Command => ({ commands }) => {
return commands.toggleMark('highlight', attributes)
},
}
},