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

Allow relative and anchor links in link edit menu, and allow users to override link-formatting behavior #288

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

sjdemartini
Copy link
Owner

@sjdemartini sjdemartini commented Nov 6, 2024

Resolves: #182 and #275

Changes:

  • The default behavior of the LinkBubbleMenu editing is to do the following to the user-entered URL when they finish typing:
    • trim leading/trailing whitespace (unchanged)
    • ensure the value has a protocol (http://) if it doesn't already and isn't a relative (starting with "/") or anchor (starting with "#") URL (change in behavior)
    • URL-encode the result (unchanged)
  • The input field is now of type text instead of url to support relative URLs. So it will be less strict in enforcing URL formatting.
  • LinkBubbleMenu now has a formatHref prop which can be used to override the above link-formatting behavior and provide custom functionality (resolves How do I skip the formatHref behavior? #182)

@sjdemartini sjdemartini force-pushed the link-edit-improvements branch from 52f14de to 4ecf2c4 Compare November 6, 2024 21:21
@sjdemartini sjdemartini merged commit 42ce49b into main Nov 6, 2024
1 check passed
@sjdemartini sjdemartini deleted the link-edit-improvements branch November 6, 2024 21:24
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.

Allow to add internal links using EditLinkMenuContent How do I skip the formatHref behavior?
1 participant