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

Add unlink functionality #215

Merged

Conversation

f-fardin-dev
Copy link
Contributor

This PR introduces the unlink functionality. Currently, users are unable to unlink text once it has been linked. If a user selects linked text and presses the create-link button, a prompt is shown instead of unlinking the text (expected behavior). This requires users to manually remove the link by deleting the text and re-adding it, which is not user-friendly.

With this update, users can now easily unlink text by selecting the linked text and pressing the link button, which will remove the link without the need for manual text removal.

Changes

  • Added the isLinkSelected method to identify if the selected text contains an anchor tag.
  • Updated the link button behavior to remove links when pressed on already linked text.
  • Updated the button title to “Add or remove link” to reflect its dual functionality.

Testing

  • Verified that pressing the link button on linked text now execute the "unlink" command.
  • Ensured that the prompt is only shown when linking new text.
  • Verified the behavior of the isLinkSelected method in different scenarios.

Notes

This enhancement improves the user experience by providing a straightforward way to unlink text, aligning with common text editor functionalities.

Copy link

sonarcloud bot commented Aug 19, 2024

@stevermeister
Copy link
Owner

@f-fardin-dev good one, thank you for the contribution and detailed description!

@stevermeister stevermeister merged commit b51657a into stevermeister:master Aug 21, 2024
2 checks passed
@stevermeister
Copy link
Owner

Successfully published ngx-wig@18.1.6

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.

2 participants