I was editing someone's question to make a link to https://codepen.io clickable. However, the editor did not allow me to make the link clickable with the following error:

enter image description here

"Links to codepen.io must be accompanied by code", even though there was a big chunk of preformatted code immediately following the link. It looks like this restriction doesn't recognize code within the "<pre>" tags, because once I removed the tags, the eror went away, even though the code always had 4 spaces:

enter image description here

This is the revision in question. Is this a bug, or is there a special way to handle this with "<pre>" tags?

  • When the checker sees the <pre> tag, it doesn't know that what follows is code; it could just be text the user wanted to be monospace. BTW, Markdown code blocks (i.e. those indented by 4 spaces) are rendered with <pre><code> ... </code></pre> tags already. – Heretic Monkey Oct 19 '18 at 20:55

Text inside "pre" tags is not considered code - converting such incorrectly formatted text into proper one with 4 (or 8 for lists) spaces is the right action.

Why: in part because <pre> may not represent all code correctly, in particular anything with <…> will be formatted incorrectly at best - Posting code using the <pre><code> tags.

You must log in to answer this question.

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