Hey #Markdown friends. Is this valid markdown?
-
π€ Seb :google: :cwtiPizza:replied to Terence Eden last edited by
@Edent I don't have a list, only experience in noticing that different flavours will interpret edge cases differently. In general I have come to consider CommonMark as the correct spec, for practicality and completeness
-
Terence Edenreplied to π€ Seb :google: :cwtiPizza: last edited by
@seb ta!
-
I think I've found a bug in nearly every #Markdown parser.
Most of them will autolink URls.
But consider this:
```
<a href="https:/example.com">You *must* visit https:/example.com</a>
```You'll get back:
```
<a href="https:/example.com/">You <em>must</em> visit <a href="https:/example.com">https:/example.com</a></a></p>
```All the Markdon inside the <a> - including the link - is processed.
The HTML is invalid; you can't nest <a>s like that.
Bug or not?
-
@Edent the bug is auto linking URLs. If I want it linked, there's syntax for that.
-
@craignicol did you type out `<a href="[email protected]">@Edent</a>` or just the name
-
@Edent I just hit the reply button
But in this context, the @ symbol followed by an identifier is sufficient context for the parser to understand I was referring to a person and to link it appropriately. If I'd just typed [email protected] I wouldn't expect it to be linked because a leading @ is part of the syntax for this service.
-
@craignicol is the https:// symbol not also sufficient context?
(I'm not being snarky, honest! I'm just trying to get an idea of what people think the right behaviour is.)
-
@Edent from my experience, I see https://link.com left as plaintext
https://link.com -> <p>https://link.com</p>
and it is auto-linked only if it's wrapped in crocodiles, i.e.,
<https://link.com> -> <p><a href="https://link.com">https://link.com</a></p>
I can find this only in the commonmark spec: https://spec.commonmark.org/0.31.2/#autolink
and this blog by an enthusiastic sounding person https://jackdewinter.github.io/2020/03/09/markdown-linter-autolinks-raw-html-and-line-breaks/#autolinks
-
Chris Lilley π΄σ §σ ’σ ³σ £σ ΄σ Ώreplied to Terence Eden last edited by
@Edent Nitpicking third opinion: it is a design flaw in HTML that nested links are disallowed, and represents a failure of imagination.
-
Peter Rushforth π¨π¦πΊπ¦replied to Chris Lilley π΄σ §σ ’σ ³σ £σ ΄σ Ώ last edited by
-
Terence Edenreplied to Chris Lilley π΄σ §σ ’σ ³σ £σ ΄σ Ώ last edited by
@svgeesus
Someone should do something about that -
Chris Lilley π΄σ §σ ’σ ³σ £σ ΄σ Ώreplied to Peter Rushforth π¨π¦πΊπ¦ last edited by
@prushforth @Edent This is what I meant by failure of imagination. Styling is capable of making nested links clearly discernable. Nothing says that all links are the same shade of blue with no other highlighting. Nothing says that child elements always render with 100% overlap of their parent.
-
Terence Edenreplied to Chris Lilley π΄σ §σ ’σ ³σ £σ ΄σ Ώ last edited by
@svgeesus @prushforth
Yup.I could see
<a href="">William (<a href="">and Anne</a>) Shakespeare</a>
or something being very useful as syntax. -
@svgeesus @Edent I tried, many moons ago: http://meyerweb.com/eric/thoughts/2008/06/05/strengthening-links/