mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
refactoring
This commit is contained in:
parent
56beb707ab
commit
f29b39238b
@ -39,38 +39,34 @@ export default class Code extends Mark {
|
||||
}
|
||||
|
||||
inputRules() {
|
||||
return [
|
||||
markInputRule(
|
||||
VerEx()
|
||||
.add('(?:^|\\s)')
|
||||
.beginCapture()
|
||||
.find('`')
|
||||
.beginCapture()
|
||||
.somethingBut('`')
|
||||
.endCapture()
|
||||
.find('`')
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.type,
|
||||
)
|
||||
]
|
||||
return markInputRule(
|
||||
VerEx()
|
||||
.add('(?:^|\\s)')
|
||||
.beginCapture()
|
||||
.find('`')
|
||||
.beginCapture()
|
||||
.somethingBut('`')
|
||||
.endCapture()
|
||||
.find('`')
|
||||
.endCapture()
|
||||
.endOfLine(),
|
||||
this.type,
|
||||
)
|
||||
}
|
||||
|
||||
pasteRules() {
|
||||
return [
|
||||
markPasteRule(
|
||||
VerEx()
|
||||
.add('(?:^|\\s)')
|
||||
.beginCapture()
|
||||
.find('`')
|
||||
.beginCapture()
|
||||
.somethingBut('`')
|
||||
.endCapture()
|
||||
.find('`')
|
||||
.endCapture(),
|
||||
this.type,
|
||||
)
|
||||
]
|
||||
return markPasteRule(
|
||||
VerEx()
|
||||
.add('(?:^|\\s)')
|
||||
.beginCapture()
|
||||
.find('`')
|
||||
.beginCapture()
|
||||
.somethingBut('`')
|
||||
.endCapture()
|
||||
.find('`')
|
||||
.endCapture(),
|
||||
this.type,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user