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

Autolink should not include trailing punctuation #14497

Closed
dtdesign opened this issue Jun 29, 2023 · 2 comments · Fixed by #17680
Closed

Autolink should not include trailing punctuation #14497

dtdesign opened this issue Jun 29, 2023 · 2 comments · Fixed by #17680
Assignees
Labels
domain:ui/ux This issue reports a problem related to UI or UX. intro Good first ticket. package:link squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@dtdesign
Copy link

📝 Provide detailed reproduction steps (if any)

  1. Visit the demo at https://ckeditor.com/ckeditor-5/demo/feature-rich/.
  2. Copy the URL of the page into the clipboard.
  3. Discard the editor contents.
  4. Pretend that you are writing a sentence that ends with the URL from the clipboard.
  5. Paste the URL from the clipboard at the end.
  6. Hit . to end the sentence and hit <Space> to trigger the AutoLink plugin.

✔️ Expected result

The trailing dot should not be part of the implicitly created link.

❌ Actual result

The trailing dot is added at the end of the URL.

❓ Possible solution

The trailing space is already removed from the possible text in

const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
. This could be extended to check if the last character of url contains a punctuation symbol and remove it from the url value.

I thought about adding this to the regex, but it is already complex enough and it could possibly be faster to simply check the last character of url.

📃 Other details

  • Browser: Chrome 114.0.5735.198
  • OS: macOS 13.4.1
  • First affected CKEditor version: Unknown
  • Installed CKEditor plugins: Online Demo

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@dtdesign dtdesign added the type:bug This issue reports a buggy (incorrect) behavior. label Jun 29, 2023
@Witoso Witoso added package:link domain:ui/ux This issue reports a problem related to UI or UX. intro Good first ticket. squad:core Issue to be handled by the Core team. labels Jun 30, 2023
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@cadeyrn
Copy link

cadeyrn commented Oct 30, 2024

There has been no activity on this issue for the past year.

Not quite true… there is an open PR for this issue for a half year (!) and nobody (except a bot) reviewed it …

@Mati365 Mati365 self-assigned this Dec 20, 2024
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 20, 2024
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 20, 2024
@CKEditorBot CKEditorBot added this to the iteration 82 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. intro Good first ticket. package:link squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
5 participants