in reply to Re: uc and German eszett "ß"
in thread uc and German eszett "ß"

The HTML specs are not very specific about how "code" vs "pre" really works. It's mostly on the order of "Dear Browser! FYI, this part is some sort of program code thing. Please do something about it if you want (but you are not required to)." Basically, the code tag is says "here is some text using the "monospace" font family"

The "pre" is just as vague tag preserves linebreaks and other whitespace characters and uses a fixed-width font. And again, that is pretty much all that the standard says about that, as far as i can tell.

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Replies are listed 'Best First'.
Re^3: uc and German eszett "ß"
by choroba (Cardinal) on Feb 02, 2022 at 14:25 UTC
    HTML spec is irrelevant here, PerlMonks interprets <code> in its own way.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^3: uc and German eszett "ß"
by kcott (Archbishop) on Feb 02, 2022 at 22:01 UTC

    As ++choroba correctly points out, PM <code> is not HTML <code>. See "Markup in the Monastery".

    The PM <code> tag provides some conveniences. It automatically handles certain special characters; for instance, you can paste code with $x < $y without having to manually change that to $x &lt; $y. It also adds the "download" link for blocks of code.

    The <code> and <c> are interchangeable. I usually use the former for blocks and the latter for inline: that's just a personal preference.

    With <pre> and <tt>, you will need to manually edit special characters; accordingly, I try to keep these as small as possible. You also don't get the "download" link.

    — Ken