Skip to content
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

Core: Fix classes being duplicated on mergeAttributes function #4320

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

bdbch
Copy link
Contributor

@bdbch bdbch commented Aug 11, 2023

Please describe your changes

Before this change, the class attribute on HTMLAttributes would be duplicated inside the mergeAttributes function, because there was no check if a class already exists on the HTMLAttributes string (coming from defaultOptions and inputOptions).

This PR fixes this.

How did you accomplish your changes

Added a check if the className is already included inside the class attribute.

How have you tested your changes

Tested locally in the link demo with normal class and BEM class style

How can we verify your changes

See above

Checklist

  • The changes are not breaking the editor
  • Added tests where possible
  • Followed the guidelines
  • Fixed linting issues

Related issues

fixes #4282

@bdbch bdbch added Type: Bug The issue or pullrequest is related to a bug Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. labels Aug 11, 2023
@bdbch bdbch self-assigned this Aug 11, 2023
@bdbch bdbch requested a review from svenadlung as a code owner August 11, 2023 16:21
@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 64b1046
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/64d662a2e01aa300087ada63
😎 Deploy Preview https://deploy-preview-4320--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@bdbch bdbch merged commit 0e65d95 into develop Aug 16, 2023
14 checks passed
@bdbch bdbch deleted the bdbch/4282-duplicated-link-classes branch August 16, 2023 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug]: CSS classes are being duplicated with the links <a>
2 participants