add typography extension

This commit is contained in:
Philipp Kühn
2020-11-01 00:28:46 +01:00
parent 4ce0eef6c0
commit 97831ea8e5
3 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
import { createExtension } from '@tiptap/core'
import {
emDash,
ellipsis,
openDoubleQuote,
closeDoubleQuote,
openSingleQuote,
closeSingleQuote,
} from 'prosemirror-inputrules'
const Typography = createExtension({
addInputRules() {
return [
emDash,
ellipsis,
openDoubleQuote,
closeDoubleQuote,
openSingleQuote,
closeSingleQuote,
]
},
})
export default Typography
declare module '@tiptap/core/src/Editor' {
interface AllExtensions {
Typography: typeof Typography,
}
}