feat(extension-typography): add servicemark input rule (#3220)

* feat(extension-typography): add servicemark input rule

* fix formatting issue
This commit is contained in:
Sven Adlung 2022-09-20 23:53:34 +02:00 committed by GitHub
parent c7b7a166c4
commit a3978353ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}