revert some magic

This commit is contained in:
Philipp Kühn
2020-04-13 12:27:29 +02:00
parent e03d108423
commit ca16a31e75
5 changed files with 80 additions and 90 deletions

View File

@@ -33,38 +33,38 @@ export default class Code extends Mark {
}
keys() {
return 'Mod-`'
return {
'Mod-`': () => this.editor.code()
}
}
inputRules() {
return markInputRule(
VerEx()
.add('(?:^|\\s)')
.beginCapture()
.find('`')
.beginCapture()
.somethingBut('`')
.endCapture()
.find('`')
.endCapture()
.endOfLine(),
this.type,
)
const regex = VerEx()
.add('(?:^|\\s)')
.beginCapture()
.find('`')
.beginCapture()
.somethingBut('`')
.endCapture()
.find('`')
.endCapture()
.endOfLine()
return markInputRule(regex, this.type)
}
pasteRules() {
return markPasteRule(
VerEx()
.add('(?:^|\\s)')
.beginCapture()
.find('`')
.beginCapture()
.somethingBut('`')
.endCapture()
.find('`')
.endCapture(),
this.type,
)
const regex = VerEx()
.add('(?:^|\\s)')
.beginCapture()
.find('`')
.beginCapture()
.somethingBut('`')
.endCapture()
.find('`')
.endCapture()
return markPasteRule(regex, this.type)
}
}