add typography extension
This commit is contained in:
30
packages/extension-typography/index.ts
Normal file
30
packages/extension-typography/index.ts
Normal 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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user