-3

On EL&U Meta, I wrote a comment:

You could ask on Writers, but I don't think you necessarily need to ask on StackExchange at all. This is covered by the general references on rhetorical devices. The famous Silva Rhetoricae has this to say: repetition of the same letter or sound within nearby words. Similarly, LiteraryDevices.net: It is a stylistic device in which a number of words, having the same first consonant sound, occur close together in a series. I don't see call for the premise that the words must be seriatim.

The Markdown of that comment was this:

You could ask on Writers, but I don't think you necessarily need to ask on StackExchange at all. This is covered by the general references on rhetorical devices. The famous [Silva Rhetoricae](https://rhetoric.byu.edu/Figures/A/alliteration.htm) has this to say: *repetition of the same letter or sound within **nearby** words*. Similarly, [LiteraryDevices.net](https://literarydevices.net/alliteration/): *It is a stylistic device in which a number of words, having the same first consonant sound, occur **close together** in a series*. I don't see call for the premise that the words must be seriatim.

But unlike in the blockquote above, which I have fixed manually, the comment kept rendering in the comment area as:

You could ask on Writers, but I don't think you necessarily need to ask on StackExchange at all. This is covered by the general references on rhetorical devices. The famous (Silva Rhetoricae)‌[rhetoric.byu.edu/Figures/A/alliteration.htm] has this to say: repetition of the same letter or sound within nearby words. Similarly, LiteraryDevices.net: It is a stylistic device in which a number of words, having the same first consonant sound, occur close together in a series. I don't see call for the premise that the words must be seriatim.

That is, everything seemed to work, except the first link (to the Silva Rhetoricae) was not link-ified, and you could see its Markdown. But the second link worked fine, using identical syntax, as did the italics and boldface. I tried fiddling with it several times, but nothing I did resulted in an operational link.

ELU moderator @MetaEd♦︎ stepped in and fixed this for me. When I asked him what he'd changed to make it work, since I'd tried several times to no avail, he said (in chat):

I think the original link was incomplete, just began with the domain name: rhetoric.byu.edu/Figures/A/alliteration.htm I wanted to add https:// but due to space constraints ended up just adding // Protocol-relative links are not the best choice especially when linking to other pages on the site. Because the site actually tries to recognize such links and add them to the sidebar, and protocol-relative links sidestep the link recognition.

So the problem is Markdown doesn't link-ify (foo)[bar]-style links if bar doesn't start with a protocol.

This seems wrong to me. So, questions:

  1. Given the syntax (foo)[bar] explicitly and literally says "I want you to render a link here with text "foo" and target bar, why is a protocol required on the reference?
    • Why can't the Markdown be rendered as <a href="bar">foo</a> and defer the protocol selection to the browser (which are built to resolve such ambiguities)?
  2. I am not aware of any documentation on this limitation. Browsing the top questions on Meta doesn't reveal anything relevant. Are SE users expected to be aware of this limitation? If so, is it imposed by Markdown, SE's selection of a particular variant of Markdown, or SE's implementation?
  3. Can we lift this restriction? If not, why not? If it's a security issue, why can't we defer resolving such security risks to the browser?
0

1 Answer 1

7

A link without a protocol is not a valid link. If we did render it as a link, the browser would interpret it as a relative link and pre-pend the current domain and path to it.

For example, a link to only rhetoric.byu.edu/Figures/A/alliteration.htm posted on English SE would get directed to something like english.meta.stackexchange.com/questions/11016/why-is-my-alliteration-question-off-topic-and-put-on-hold/rhetoric.byu.edu/Figures/A/alliteration.htm when interpreted by the browser.

You must specify a protocol always. We intentionally don't render links without them because they would not go to the correct place.

4
  • Thank you for the answer. +1. I am surprised, because I believe browsers would render <a href="www.monkeys.example.com">Free monkeys!</a> in this comment as link with the text "Free monkeys!" and the target http://www.monkeys.example.com. I cannot believe the wild web is rigorous enough to let browsers to get away with making the target https://www.monkeys.example.com.meta.stackexchange.com. I think this philosophical restriction must be imposed by SE. If it is, can you do me a favor and edit into your question a link to where SE users are informed od this? Or MD users if imposed by MD.
    – Dan Bron
    Nov 29, 2017 at 21:28
  • The browser would treat that in exactly the same way, making the full path something like https://english.stackexchange.com/www.monkeys.example.com and not link to the actual domain you want. That's how browsers work.
    – animuson StaffMod
    Nov 29, 2017 at 21:30
  • Huh, what do you know. Well, I learned something. Still, would be helpful if you could link to the relevant guidance here or in the Markdown spec, or if it's not currently noted in either place, could we update our Markdown FAQ or documentation? (And sorry, I forgot to actually apply the +1 before; have done so now.)
    – Dan Bron
    Nov 29, 2017 at 21:32
  • 1
    @DanBron there is no guidance in markdown, this is not a markdown thing. It's how URIs work. It's not really up to SO to educate people about this.
    – user229044
    Nov 30, 2017 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .