top | item 46715746

(no title)

chrismorgan | 1 month ago

> 1. Seems unavoidable because there is no natural order for these two elements.

There is a solution: restructure it so the href part is inside the link, rather than adjacent to, which is the real problem. reStructuredText had `text <href>`_. In that form, the trailing underscore is a wart, but there’s more justification to it than it may initially seem (where Markdown can have [text] or [text][], reStructuredText’s equivalent is text_ or `text`_). For my own lightweight markup language, I’ve been using [text <href>] for a couple of years (and had {text <href>} before that).

> Parentheses in urls often end up percent encoded whether they need to be or not.

That’s what you can expect from something implementing RFC 3986; but these days, almost everything uses WHATWG’s URL Standard <https://url.spec.whatwg.org/>, under whose rules parentheses are not percent-encoded.

> I actually don’t think that matches the way people usually write urls in non-markup formatting

It isn’t any more, but it used to be very common.

discuss

order

dpark|1 month ago

I don’t really understand how reStructuredText’s approach fixes this. The fundamental thing is that you need to remember the order and the syntax. reStructuredText matches the order of Markdown (and so does not match html) but not the syntax. It also seems like a fine format.

> under whose rules parentheses are not percent-encoded.

I don’t know. I feel like half the time I end up with parens encoded. I’ll have to keep an eye on it. Maybe that behavior isn’t common anymore.

> [urls identified with <link> in plain text] used to be very common.

I don’t recall this being common but it’s possible I’m just not remembering.