WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Well formed verses Valid code

for

From: Alastair Campbell
Date: Feb 26, 2007 7:30AM


Phil Teare wrote:
> if you're marking up markup or script (which you'll prob have
> to encode anyway) please stick it in a div and label it code

Surely the author/CMS should put the snippet in a pre and/or code?

I tend to use this for blocks of code:

<pre><code>
[code here]
</code></pre>

And just a code element for inline bits. Anything in a pre, code, var,
kbd etc. could justifiably have a different rendering, audio or
otherwise.

I guess the hard part is authors who don't encode their content
snippets? In which case uuencoded ampersands would cause issues,
although perhaps not when in an attribute such as href?

> e.g. if any of the code snippet looks like the TTS engine's take
> on SOAP, SAMPA, IPA, or more likely its own proprietory XML based
insertable
> command strings (for a section to be read faster, louder, by a
different
> voice etc...),

Are certain UAs are looking for their own custom XML snippets in the
page? Surely that would encouraging inline, agent-specific styling/code?

Kind regards,

-Alastair

--
Alastair Campbell | Director of User Experience

Nomensa Email Disclaimer:
http://www.nomensa.com/email-disclaimer.html