mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 11:49:02 +08:00
feat(extension-typography): add servicemark input rule (#3220)
* feat(extension-typography): add servicemark input rule * fix formatting issue
This commit is contained in:
parent
c7b7a166c4
commit
a3978353ff
@ -11,6 +11,7 @@ export interface TypographyOptions {
|
||||
rightArrow: false,
|
||||
copyright: false,
|
||||
trademark: false,
|
||||
servicemark: false,
|
||||
registeredTrademark: false,
|
||||
oneHalf: false,
|
||||
plusMinus: false,
|
||||
@ -74,6 +75,11 @@ export const trademark = textInputRule({
|
||||
replace: '™',
|
||||
})
|
||||
|
||||
export const servicemark = textInputRule({
|
||||
find: /\(sm\)$/,
|
||||
replace: '℠',
|
||||
})
|
||||
|
||||
export const registeredTrademark = textInputRule({
|
||||
find: /\(r\)$/,
|
||||
replace: '®',
|
||||
@ -175,6 +181,10 @@ export const Typography = Extension.create<TypographyOptions>({
|
||||
rules.push(trademark)
|
||||
}
|
||||
|
||||
if (this.options.servicemark !== false) {
|
||||
rules.push(servicemark)
|
||||
}
|
||||
|
||||
if (this.options.registeredTrademark !== false) {
|
||||
rules.push(registeredTrademark)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user