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

Fix(#6040) Line code is not working properly when we use backticks ar… #6119

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Aribaskar-jb
Copy link

@Aribaskar-jb Aribaskar-jb commented Feb 22, 2025

Changes Overview

  • Added Conditional Checks for "code" Marks: Prevents unnecessary deletion of text when applying the "code" mark.
  • Adjusted Deletion Logic (tr.delete): Modifies the range when deleting text to handle cases where there are no spaces before backticks.
  • Updated Mark Application (tr.addMark): Uses different logic for "code" marks to ensure correct text selection.
  • Ensured Stored Marks Are Removed (tr.removeStoredMark): No changes, but remains important for clearing previous marks.

Implementation Approach

  • Identify the Issue: The existing logic was deleting characters incorrectly when applying the "code" mark using backticks.
  • Introduce Conditional Checks: Added if (config.type.name === "code") to handle "code" marks separately.
  • Adjust Text Deletion (tr.delete): Modified the start and end positions for "code" to prevent accidental removal of previous characters.
  • Apply Marks Correctly (tr.addMark): Used different range calculations for "code" marks while keeping the original logic for other marks.

Testing Done

Tested in application with dynamic user content.

Verification Steps

Additional Notes

Checklist

  • I have created a changeset for this PR if necessary.
  • My changes do not break the library.
  • I have added tests where applicable.
  • I have followed the project guidelines.
  • I have fixed any lint issues.

Related Issues

#6040
#6053

Copy link

changeset-bot bot commented Feb 22, 2025

⚠️ No Changeset found

Latest commit: 0f52fa7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Feb 22, 2025

Deploy Preview for tiptap-embed failed. Why did it fail? →

Name Link
🔨 Latest commit 0f52fa7
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/67b9ccd5e81ee90008e0ee48

@Aribaskar-jb Aribaskar-jb marked this pull request as draft February 23, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant