ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* never add a hyphen to break a URL
@ 2022-10-24 16:54 Steffen Wolfrum via ntg-context
  2022-10-24 18:04 ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-10-24 16:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Steffen Wolfrum

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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_word_form_only][][{https://litteraturbanken.se/f\%C3\%B6rfattare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil? show_sear-ch_work&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: never add a hyphen to break a URL
  2022-10-24 16:54 never add a hyphen to break a URL Steffen Wolfrum via ntg-context
@ 2022-10-24 18:04 ` Pablo Rodriguez via ntg-context
  2022-10-25  9:05   ` Steffen Wolfrum via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-10-24 18:04 UTC (permalink / raw)
  To: Steffen Wolfrum via ntg-context; +Cc: Pablo Rodriguez

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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: never add a hyphen to break a URL
  2022-10-24 18:04 ` Pablo Rodriguez via ntg-context
@ 2022-10-25  9:05   ` Steffen Wolfrum via ntg-context
  2022-10-25  9:47     ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-10-25  9:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Steffen Wolfrum, Pablo Rodriguez


[-- Attachment #1.1: Type: text/plain, Size: 989 bytes --]

This does not open the right link.

At least on my machine nothing happens when clicking on «litteraturbanken.se <http://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 <ntg-context@ntg.nl <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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_word_form_only <https://litteraturbanken.se/f%C3%B6rfattare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil?show_search_work&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_word_form_only>]
> \stoptext


[-- Attachment #1.2: Type: text/html, Size: 8713 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: never add a hyphen to break a URL
  2022-10-25  9:05   ` Steffen Wolfrum via ntg-context
@ 2022-10-25  9:47     ` Hans Hagen via ntg-context
  2022-10-25 10:11       ` Steffen Wolfrum via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen via ntg-context @ 2022-10-25  9:47 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

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 <http://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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: never add a hyphen to break a URL
  2022-10-25  9:47     ` Hans Hagen via ntg-context
@ 2022-10-25 10:11       ` Steffen Wolfrum via ntg-context
  2022-10-25 16:15         ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Wolfrum via ntg-context @ 2022-10-25 10:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Steffen Wolfrum



> Am 25.10.2022 um 11:47 schrieb Hans Hagen via ntg-context <ntg-context@ntg.nl>:
> 
> 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 <http://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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_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&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_word_form_only][][{https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil? show_sear-ch_work&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_word_form_only}]\from[test] after

   works \useURL[test][https://litteraturbanken.se/f\%C3\%B6rfattare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil? show_search_work&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_word_form_only][][{https://litteraturbanken.se/författare/CollijnI/titlar/ActaEtProcessusCanon/sida/614/faksimil? show_sear-ch_work&s_query=retractata&s_lbworkid=lb487378&s_mediatype=faksimil&s_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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: never add a hyphen to break a URL
  2022-10-25 10:11       ` Steffen Wolfrum via ntg-context
@ 2022-10-25 16:15         ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 6+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-10-25 16:15 UTC (permalink / raw)
  To: Steffen Wolfrum via ntg-context; +Cc: Pablo Rodriguez

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-25 16:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 16:54 never add a hyphen to break a URL Steffen Wolfrum via ntg-context
2022-10-24 18:04 ` Pablo Rodriguez via ntg-context
2022-10-25  9:05   ` Steffen Wolfrum via ntg-context
2022-10-25  9:47     ` Hans Hagen via ntg-context
2022-10-25 10:11       ` Steffen Wolfrum via ntg-context
2022-10-25 16:15         ` Pablo Rodriguez via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).