Open bdbch opened 2 weeks ago
Latest commit: 3fa56e779ee350626ddfa4aab3ef733b1d18758d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Link |
---|---|
Latest commit | 3fa56e779ee350626ddfa4aab3ef733b1d18758d |
Latest deploy log | https://app.netlify.com/sites/tiptap-embed/deploys/672251d4d3b0a70008af7223 |
Deploy Preview | https://deploy-preview-5786--tiptap-embed.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Just figured - the addGlobalAttributes
function will add all attributes to the Tiptap JSON which is what we don't want. I'll see if I can find a different solution again.
Changes Overview
This pull request introduces a new feature to add type attributes to nodes and marks in the editor for better identification, which can be useful for testing and styling purposes. The changes span across multiple files to implement and support this feature.
This makes it easier to style specific HTML elements of the editor while not overwriting any styles for node view related elements or other decorations that may unwillingly be styled.
If enabled, a node could be rendered like this in HTML:
Implementation Approach
I added a new option called
addTypeAttributes
to the editor which is global and enabled by default. ThisaddTypeAttributes
option enables aTypenames
extension that will dynamically add those type names to the editor DOM.Those attributes are currently stripped from the editors output.
Testing Done
I tested this all locally on any test of our demos pages.
Verification Steps
Clone and check the branch for your self or check the deployed netlify page.
Additional Notes
I don't think this is a breaking change as it's not really changing the general behavior of the editor and the
data-node-type
attribute is vague enough to not be used by the general user base.Checklist