Opened 4 years ago

Last modified 2 years ago

#13669 confirmed New Feature

Improve the heuristic for URL recognition in autolink

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version: 4.5.0 Beta
Keywords: Cc:

Description (last modified by Piotrek Koszuliński)

Steps to reproduce

Based on https://twitter.com/l0c0luke/status/633684769121832960

Autolink will not recognise youtu.be/cSVuh_8-VQs as a link, hence autoembed will not find it too. Links without protocols are a common case as browsers hide them in the URL bar.

Expected result

We may try to improve the heuristic so it autolinks such URLs. It may happen that it will start autolinking too much, but links can always be removed, so it should not be a big problem as long as it's not happening for typical plain text.

Change History (3)

comment:1 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)
Status: newconfirmed
Summary: Improve heuristic for URL recognition in autolinkImprove the heuristic for URL recognition in autolink

comment:2 Changed 3 years ago by Jakub Ś

From what I have checked autolink will only work when you paste http://o2.pl but not when you paste text http://o2.pl text or http://o2.pl www.o2.pl test.com. It only assumes that user pastes a link and nothing else.

I personally think this is too strict and that we should allow more:

  1. first case is easy - text http://o2.pl text. We just need to remove ^ $ from pattern
  2. Second case I'm not sure - should autolink only recognize links starting with http(s)? or www. as well?

comment:3 Changed 3 years ago by Jakub Ś

Other issues for autolink plugin: #14769, #16685.

Last edited 2 years ago by Jakub Ś (previous) (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy