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

Auto-link correction #11040

Closed
net3000 opened this issue Dec 22, 2021 · 7 comments · Fixed by #12424
Closed

Auto-link correction #11040

net3000 opened this issue Dec 22, 2021 · 7 comments · Fixed by #12424
Assignees
Labels
intro Good first ticket. squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@net3000
Copy link

net3000 commented Dec 22, 2021

📝 Provide detailed reproduction steps (if any)

  1. …type www.google.com in content (without http)
  2. …inspect the link, you'll find it with href='www.google.com' which is invalid

✔️ Expected result

href='https://www.google.com'

❌ Actual result

href='www.google.com'

❓ Possible solution

Either auto-link would add https:// to the link, or doesn't link www.google.com

@net3000 net3000 added the type:bug This issue reports a buggy (incorrect) behavior. label Dec 22, 2021
@Reinmar
Copy link
Member

Reinmar commented Dec 23, 2021

I can confirm this issue. Thank you for reporting it.

@Reinmar Reinmar added intro Good first ticket. squad:core Issue to be handled by the Core team. labels Dec 23, 2021
@Reinmar
Copy link
Member

Reinmar commented Dec 23, 2021

The question we could ask is whether we can assume that a website supports https? Maybe we shouldn't create the link at all in this case.

I'd agree, though, that going with https makes more sense as if someone typed a link, then it's most likely to a well-known website that most likely support https already. Also, this is more future-oriented.

@net3000
Copy link
Author

net3000 commented Dec 23, 2021 via email

@neongreen
Copy link

neongreen commented Dec 26, 2021

I think I've seen this being solved with a "defaultProtocol" config option in some other library (can choose http if you want to err on the side of caution or https if you don't care). Don't remember what it was though. Maybe a Markdown library or another editor widget.

I personally would be much happier with https:// than with autolink being disabled for google.com.

@pomek
Copy link
Member

pomek commented Dec 26, 2021

Couldn't we re-use already implemented the config.link.defaultProtocol option?

@scofalik scofalik added squad:collaboration Issue to be handled by the Collaboration team. and removed squad:core Issue to be handled by the Core team. labels Sep 2, 2022
@scofalik
Copy link
Contributor

scofalik commented Sep 5, 2022

config.link.defaultProtocol is actually used (if set) when autolinking.

@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Sep 5, 2022
@scofalik
Copy link
Contributor

scofalik commented Sep 5, 2022

We decided to cancel auto-linking if: there's no default protocol and the URL does not contain protocol:

  1. www.ckeditor.com will not get autolinked if default protocol is not set.
  2. www.ckeditor.com will get autolinked using default protocol, if default protocol is set.
  3. ckeditor.com will never get autolinked.
  4. http://ckeditor.com and http://www.ckeditor.com will get autolinked with http:// no matter what default protocol is used.

@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Sep 7, 2022
scofalik added a commit that referenced this issue Sep 9, 2022
Fix (link): Corrected autolinking URLs without protocol. Closes #11040.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Sep 9, 2022
@CKEditorBot CKEditorBot added this to the iteration 57 milestone Sep 9, 2022
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Sep 13, 2022
@pomek pomek removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intro Good first ticket. squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants