zim-wiki team mailing list archive
Mailing list archive
Re: URLs without domain do not get auto-hyperlinked
I think a fix could be implemented by making paste of a URL a special case.
What is happening here is that the URL is probably pasted as text (you can
check debug output to make sure) and therefore parsed using the wiki
syntax. If the URL were pasted as an URL data type it would always be
formatted as a link. Therefore we could make the copy-paste code use a more
lax URL regex and if pasted text looks like an URL, apply the same logic as
for the URL data type.
Would not like to make the wiki syntax more lax, and it doesn't need to be
if the copy-paste logic properly understands the content as a link.
On Tue, May 4, 2021 at 8:20 PM Steve Chadsey <schadsey@xxxxxxxxx> wrote:
> Hi Jaap,
> Thanks for the explanation. I understand that having a spec to follow can
> simplify things at the application code level. But for an end user like me,
> it does not provide any benefit and in fact the application is more tedious
> to use because of it. A good 60-75% of the URLs I paste into zim are copied
> from the browser's URL bar for an internal work-related website that never
> has a domain name in the URL. So, what was an automatic process of
> hyperlinking in v0.68 now takes extra steps. I would understand it more if
> it were some non standard scheme or something like that, but "
> https://site/path" seems a pretty common URL pattern for intranets.
> Would there be any chance that the URL matching could be expanded for this
> case in a future release? Or, if this behavior could be modified via a
> plugin, I could look into writing one.
> On Thu, Apr 22, 2021 at 2:23 PM Jaap Karssenberg <
> jaap.karssenberg@xxxxxxxxx> wrote:
>> Yes, this is intentional. Followed the Github Flavored Markdown spec on
>> how to match valid URLs. Want to avoid too lax matching. You can still turn
>> those URLs into links using Ctrl-L.
>> On Thu, Apr 22, 2021 at 6:05 PM Steve Chadsey <schadsey@xxxxxxxxx> wrote:
>>> zim version0.73.5-t202104131839~ubuntu18.04.1 on Ubuntu 18.04.5 LTS,
>>> 4.15.0-140-generic, x86_64
>>> I've just updated from 0.68~rc1-2 to the above version. I have noticed
>>> that when I paste URLs that contain only a hostname (e.g.,
>>> https://site/path) into a page, they don't get auto-hyperlinked. When
>>> the hostname is fully qualified, the URLs do get auto-hyperlinked. Is this
>>> a known issue? Both URL types would get auto-hyperlinked in the 0.68
>>> Steps to reproduce:
>>> 1. Paste or type a URL into a zim page
>>> 2. Hit <enter> or ctrl-R to refresh
>>> Test cases:
>>> Steve Chadsey <schadsey@xxxxxxxxx>
>>> Mailing list: https://launchpad.net/~zim-wiki
>>> Post to : zim-wiki@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~zim-wiki
>>> More help : https://help.launchpad.net/ListHelp
> Steve Chadsey <schadsey@xxxxxxxxx>