Bug in markdown rendering of pathological links

Hi

I like to enter academic references using markdown format [name, year](doi link) … but bad things happen with this doi link https://doi.org/10.1175/1520-0442(2003)016<0571:BPOASF>2.0.CO;2

(Why the American Met Society uses such nasty links is beyond me).

Anyway, I suspect you need to update whatever regex you use to correctly identify links …

Thanks for sending it. I believe we use Apple’s own link data detectors.

You can probably enter the links in some other way. Eg. using a menu on Mac, or using the keyboard bar + button on iOS. That way you can add the link, and put some other text as the label.

Ta. I haven’t found a tidy way to hide the link, but I can at least drop it in. Maybe you could raise this as a bug to Apple. It seems hard to believe they have a detector that fails on valid URLs.

I would have to look it up, but I’m not 100% that is a valid URL. Parentheses, greater than and less than may not be valid in the path. Even if they are, I could imagine many parsers getting that wrong.

Eg. URLs give ? and & special meaning for querying. Punctuation in general is risky. I tend to percent escape every argument to avoid this risk.

It’s used by the American Meteorological Society in their DOIs which are valid http links using every browser I know. I’d put substantial money on the proposition that these are valid links … (I think they’re stupid, but …)

They are used yes, I remember these exact type of DOI links from my time with Papers. However, I don’t believe they are strictly correct according to the URL spec. I know the browsers support them because they are quite lenient towards people typing things in, and as such they work, but I don’t believe they’re 100% legal according to the spec. Formally they should be encoded. In Papers I indeed had to resort to special tricks to support these DOI urls.

As a quick follow up, if you click the link example you give and open it in safari you will notice that the url will change actually and Safari does the character encoding for you:

https://journals.ametsoc.org/doi/full/10.1175/1520-0442%282003%29016%3C0571%3ABPOASF%3E2.0.CO%3B2

Ok, thanks, fair point about encoding. I suspect I should be bleating harder to the AMS, rather than you. Will try to hassle them some more.

1 Like