Why does Discourse prefer footnote-style Markdown links?

AI 生成的摘要

The discussion explores why Discourse defaults to footnote-style Markdown links ([text][ref]) over inline links ([text](url)). erlend_sh questions the choice, suggesting it might be a remnant of Stack Overflow days and arguing that inline syntax is less error-prone and easier to modify. BiosElement counters that while inline links are easier to author, the footnote style is superior for readability when editing raw Markdown without a preview. codinghorror agrees that long URLs buried in sentences degrade readability. waldir synthesizes the point, noting that since Discourse posts are primarily consumed as rendered HTML rather than source code, the inline style should theoretically be preferred. Finally, erlend_sh proposes implementing this change with the new composer, to which eviltrout suggests the new composer might already handle this automatically.

I’m referring to this kind of linking:
[see this article][1]

… which is the Discourse default, as opposed to this type of linking:
[see this article](http://example.com/article)

I’m curious, why are you opting for the footnote style of linking? Is it just a remnant of the StackOverflow days?

I find the [title](link) syntax to be much less error prone. It makes it considerably easier to change or remove links, and it’s most likely the syntax you’ll adhere to if you’re formatting the entire link by hand.

7 个赞

Maybe less error prone, but much harder to read if you’re editing the markdown without the help of a preview window. Is this perhaps an important use-case? If so, then I’d say the footnote-style makes a lot of sense. Otherwise, it does indeed seem to lose some of it’s benefits.

No reason, however, it is harder to read when long URLs are buried in the middle of sentences.

5 个赞

It seems to me that the inline style is easier to author, while the footnote style is easier to read.

In the case of Discourse, posts are shown in rendered html to most people – the Markdown source is usually only displayed to the post writer, so the inline style makes more sense IMO. If the text was meant to be consumed by others as source code, the footnote format would be appropriate, but that isn’t the case here.

3 个赞

@eviltrout in the spirit of the new composer & Markdown renderer, could this change in behaviour be thrown in? :wink:

1 个赞

Actually the new composer should be doing this already?

3 个赞

This topic was automatically closed 47 hours after the last reply. New replies are no longer allowed.