Re: [NTG-context] never add a hyphen to break a URL

2022-10-25 Thread Pablo Rodriguez via ntg-context
On 10/25/22 12:11, Steffen Wolfrum via ntg-context wrote:
> [...]
> …. strange, on my machine your example doesn't open the link.
>
> Please have a look here: only the last one («works …») opens the link. Why?

URIs only accept letters belonging to the US-ASCII
(https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).

Other ones (such as "ö") have to be escaped. This is why only the sample
containing the escaped "ö" (as "%C3%B6" [which TeX needs to escape
again]) worked for you.

It seems that depending on the PDF viewer (and I guess the browser),
unescaped chars in URIs are a must or not.

I’m using Evince and SumatraPDF (with Wine). Firefox opens the links
fine (even using its internal viewer).

Maybe Acrobat is more picky when passing unescaped chars in URIs.

I hope it might help,

Pablo

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] never add a hyphen to break a URL

2022-10-25 Thread Steffen Wolfrum via ntg-context


> Am 25.10.2022 um 11:47 schrieb Hans Hagen via ntg-context 
> :
> 
> On 10/25/2022 11:05 AM, Steffen Wolfrum via ntg-context wrote:
>> This does not open the right link.
>> At least on my machine nothing happens when clicking on «litteraturbanken.se 
>> ».
>> (And it looks as the link was cropped, only reads the first line?)
> 
> \setupinteraction[state=start]
> 
> \useurl
>  [litteraturbanken]
>  [https://litteraturbanken.se]
> [författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only]
>  [https://litteraturbanken.se]
> 
> \starttext
> 
>before \goto{\url[litteraturbanken]}[url(litteraturbanken)] after
> 
>before \from[litteraturbanken] after
> 
> \stoptext
> 
> beware of viewer behaviour: some viewers parse the displayed pdf
> 
> Hans



…. strange, on my machine your example doesn't open the link.

Please have a look here: only the last one («works …») opens the link. Why?


\setupinteraction[state=start]

\useurl
 [litteraturbanken]
 [https://litteraturbanken.se]
[författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only]
 [https://litteraturbanken.se]

\starttext

   before \goto{\url[litteraturbanken]}[url(litteraturbanken)] after

   before \from[litteraturbanken] after

   fails 
\useURL[test][https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?
 
show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only][][{https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?
 
show_sear-ch_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only}]\from[test]
 after

   works 
\useURL[test][https://litteraturbanken.se/f\%C3\%B6rfattare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?
 
show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only][][{https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?
 
show_sear-ch_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only}]\from[test]
 after

\stoptext


Steffen
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] never add a hyphen to break a URL

2022-10-25 Thread Hans Hagen via ntg-context

On 10/25/2022 11:05 AM, Steffen Wolfrum via ntg-context wrote:

This does not open the right link.

At least on my machine nothing happens when clicking on 
«litteraturbanken.se ».


(And it looks as the link was cropped, only reads the first line?)


\setupinteraction[state=start]

\useurl
  [litteraturbanken]
  [https://litteraturbanken.se]

[författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only]
  [https://litteraturbanken.se]

\starttext

before \goto{\url[litteraturbanken]}[url(litteraturbanken)] after

before \from[litteraturbanken] after

\stoptext

beware of viewer behaviour: some viewers parse the displayed pdf

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] never add a hyphen to break a URL

2022-10-25 Thread Steffen Wolfrum via ntg-context
This does not open the right link.

At least on my machine nothing happens when clicking on «litteraturbanken.se 
».

(And it looks as the link was cropped, only reads the first line?)

Steffen



> Am 24.10.2022 um 20:04 schrieb Pablo Rodriguez via ntg-context 
> mailto:ntg-context@ntg.nl>>:
> 
> A simpler approach would read (there is a single url, instead of two
> [less typos in the end]):
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \def\MyURL[#1]{\goto{\tt\hyphenatedurl{#1}}[url(#1)]}
> 
> \MyURL[https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only
>  
> ]
> \stoptext

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] never add a hyphen to break a URL

2022-10-24 Thread Pablo Rodriguez via ntg-context
On 10/24/22 18:54, Steffen Wolfrum via ntg-context wrote:
> Hi,
>
> according to the Chicago Manual of Style we should «never add a hyphen to 
> break a URL»:
>
> (https://www.chicagomanualofstyle.org/qanda/data/faq/topics/URLs/faq0008.html)

Hi Steffen,

I think this is not even a question of style.

myhouse.com and my-house.com are different domains.

> Is there a switch to forbid \useURL adding hyphens?

\hyphenatedurl{} is the way to go. Although you add a hyphen (and a
blank space [spaces as part of urls need to be escaped) to your url.

I would also enclose the url inside \startasciimode...\stopasciimode to
avoid escaping the percent sign.

The percent sign has to be escaped as \letterpercent (otherwise, you get
\%) in text.

A simpler approach would read (there is a single url, instead of two
[less typos in the end]):

\setupinteraction[state=start]

\starttext

\def\MyURL[#1]{\goto{\tt\hyphenatedurl{#1}}[url(#1)]}

\MyURL[https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only]
\stoptext

But https://wiki.contextgarden.net/URL has more info.

Just in case it might help,

Pablo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] never add a hyphen to break a URL

2022-10-24 Thread Steffen Wolfrum via ntg-context
Hi,

according to the Chicago Manual of Style we should «never add a hyphen to break 
a URL»:

(https://www.chicagomanualofstyle.org/qanda/data/faq/topics/URLs/faq0008.html)


Is there a switch to forbid \useURL adding hyphens?


\starttext

\useURL[test][https://litteraturbanken.se/f\%C3\%B6rfattare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?
 
show_search_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only][][{https://litteraturbanken.se/f\%C3\%B6rfattare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?
 
show_sear-ch_work_query=retractata_lbworkid=lb487378_mediatype=faksimil_word_form_only}]\from[test]%

\stoptext


Steffen
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___