add arrows to the typography extension

This commit is contained in:
Hans Pagel
2020-11-05 22:50:07 +01:00
parent 44865a2ea7
commit 7a7e517577
3 changed files with 21 additions and 1 deletions

View File

@@ -6,8 +6,12 @@ import {
closeDoubleQuote,
openSingleQuote,
closeSingleQuote,
InputRule,
} from 'prosemirror-inputrules'
export const leftwardsArrow = new InputRule(/<-$/, '←')
export const rightwardsArrow = new InputRule(/->$/, '→')
const Typography = createExtension({
addInputRules() {
return [
@@ -17,6 +21,8 @@ const Typography = createExtension({
closeDoubleQuote,
openSingleQuote,
closeSingleQuote,
leftwardsArrow,
rightwardsArrow,
]
},
})