126
you are viewing a single comment's thread
view the rest of the comments
[-] cbarrick@lemmy.world 4 points 3 months ago* (last edited 3 months ago)

Huh. This got me curious.

Yes, I did just type a bare URL. Every mature markdown parser I've used turns this into a link, and appropriately handles trailing punctuation.

So I went to the spec, and it's explicitly called out that this is not an autolink. Autolinks must be explicitly surrounded with angle brackets <>.

So yeah \shrug.

https://spec.commonmark.org/0.31.2/#autolinks

Edit to be clear: This means that both of our markdown parsers are wrong relative to the commonmark spec. But I'll argue that if a parser is going to attempt to autolink this, then handling trailing punctuation is better than not.

[-] rhymepurple@lemmy.ml 2 points 3 months ago

I did not know about autolinks - thanks for the link!

It is interesting how different parsers handle this exact situation. I usually am cautious about it because I typically am not sure how it will be handled if I am not explicit with the URL and additional text.

this post was submitted on 16 Jun 2024
126 points (97.7% liked)

Python

6219 readers
22 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS