-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow individual Typography rules to be disabled #2449
Allow individual Typography rules to be disabled #2449
Conversation
✔️ Deploy Preview for tiptap-embed ready! 🔨 Explore the source changes: 574ed26 🔍 Inspect the deploy log: https://app.netlify.com/sites/tiptap-embed/deploys/61f3011698ef2c0008f5789f 😎 Browse the preview: https://deploy-preview-2449--tiptap-embed.netlify.app |
export interface TypographyOptions { | ||
emDash: false, | ||
ellipsis: false, | ||
openDoubleQuote: false, | ||
closeDoubleQuote: false, | ||
openSingleQuote: false, | ||
closeSingleQuote: false, | ||
leftArrow: false, | ||
rightArrow: false, | ||
copyright: false, | ||
trademark: false, | ||
registeredTrademark: false, | ||
oneHalf: false, | ||
plusMinus: false, | ||
notEqual: false, | ||
laquo: false, | ||
raquo: false, | ||
multiplication: false, | ||
superscriptTwo: false, | ||
superscriptThree: false, | ||
oneQuarter: false, | ||
threeQuarters: false, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be boolean
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the same approach used in StarterKit
, where all rules are included by default and you can only disable the ones you don't want.
I can change this to boolean if you think that makes more sense. Let me know, and I'll make the change.
name: 'typography', | ||
|
||
addInputRules() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also define addOptions()
with its default values here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep the current approach where the options can only be set to false
, I believe we don't need addOptions
. Again, followed the exact same approach as StarterKit
to keep things simple. But I can change to boolean
and add addOptions
with default set to true
.
Thanks! |
The Typography extension is a great extension, but it's not very customizable. It's all or nothing for the included input rules, and this doesn't really work for us. We want some rules enabled, but all of them. I thought it would be nice if the extension could be fully configurable, allowing one to disable specific rules if one desires.
Hopefully this is something you agree with including in the official extension, otherwise we'll have to maintain our own version of this. Which is not a big deal, but it would be awesome if this could be integrated 😀