http://www.perlmonks.org?node_id=1203039


in reply to TOC draft sample

Not related to the TOC, but while we're talking about editing this page anyway... Do we really still want to recommend never using <PRE>? Because, as per Re: Non asci character and system call and its followup, and has been seen elsewhere (for example, here), if you want to include non-ASCII in your code snippet, you need to use <PRE>. So, possibly something like:


CODE vs PRE

At first blush, the <pre> ...</pre> pair may look like an alternative to code tags... BUT DON'T USE IT HERE chiefly because <pre> ...</pre> tags will not persuade the Monastery to provide a download link for the contents of the <pre>... and while it is now supposed to wrap lines that are too long for the viewer's browser window, there are ways Monks could use CSS that would defeat that. So, please, don't use <pre> ...</pre>.

Exception: non-ASCII characters inside the <code>...</code> may magically display as unrendered entities instead of the character you expected, whereas inside <pre> ...</pre>, they work as expected. For example,

<code>
$checkmarks="☐☑☒✓✗";
...
</code>

will render as

$checkmarks="&#9744;&#9745;&#9746;&#10003;&#10007;"; ...

whereas

<pre>
$checkmarks="☐☑☒✓✗";
...
</pre>

will render as

$checkmarks="☐☑☒✓✗";
...

Other Tags You Should NOT Use


update 1: renamed the section and fixed paragraphing, plus made the CODE multiline, so it properly renders with the download-link

update 2: clarified the text to explicitly say that PRE should be used in the case of non-ASCII