E-mail List Archives
Thread: use of <pre> tag
Number of posts in this thread: 24 (In chronological order)
From: Julie Dodd
Date: Thu, Nov 04 2010 4:00PM
Subject: use of <pre> tag
No previous message | Next message →
Hello,
I'm new to the list, so here's a *brief* introduction...
My name is Julie and I'm a user interface designer who also is
responsible for accessibility compliances (yes, many hats).
Quick question:
Is the use of the <pre> tag for presenting (non tabular data) content
accessible?
Under the WCAG 2.0 Guideline 1.3 (http://www.w3.org/WAI/WCAG20/quickref/Overview.php#qr-content-structure-separation-programmatic
), Info and Relationships, there are sufficient techniques for txt
documents. Does this apply to plain text presented in an HTML document
using the <pre> tag?
I have many documents (quite lengthy legal documents) that are
currently being presented in this manner. I know the content would be
more navigable using semantic markup, but is it *required*?
Thank you,
Julie
From: Simius Puer
Date: Thu, Nov 04 2010 4:30PM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hi Julie
Welcome to the list.
The short answer is: yes, it is required.
If I am correct in interpreting what you are saying, you essentially have no
mark-up other than <pre> in the entire document - in that case, whilst the
document is not "inaccessible" as such, it contains absolutely no semantic
mark-up and can not be considered accessible.
I would go beyond that to say that the presentation of the document might
also prove problematic for those with no disabilities as there is little to
guide the user as to the hierarchy of the document - so this becomes a
matter of usability rather than just accessibility.
Whilst you could argue that all the content is 'technically' accessible (in
a very tick-box approach) that doesn't make it genuinely so...and I know a
great many people on this list would even disagree with the first part of
what I've said there ;]
If you think you have great many lengthy legal documents to deal with all I
can say is that I worked as part of a team on http://www.opsi.gov.uk/ who a
few years back added a great many back-years catalogue of UK legislation to
their on-line catalogue. Not only did much of the data have to be imported
from scratch, but the work on the XML schema and HTML/CSS mark-up to be used
was very extensive....legal documents rarely have less than the 6 levels of
heading provided in HTML for a start ;]
Best regards
From: Jared Smith
Date: Thu, Nov 04 2010 5:42PM
Subject: Re: use of <pre> tag
← Previous message | Next message →
On Thu, Nov 4, 2010 at 4:28 PM, Simius Puer wrote:
> whilst the
> document is not "inaccessible" as such, it contains absolutely no semantic
> mark-up and can not be considered accessible.
Your e-mail contained no absolutely semantic mark-up, so it cannot be
considered accessible, right?
I am, of course, being a bit cynical. The lack of markup doesn't
render something automatically inaccessible. Either the lack of markup
where markup is necessary or the inappropriate use of markup might
make something less accessible.
Perhaps Julie can explain what she means by "non-tabular data". I
can't envision how non-tabular data would be any more accessible if
presented using <pre>.
The <pre> element usually presents text in a mono-spaced font, which
could be useful so long as other relationships or semantics are not
being presented purely through the visual presentation. For example,
if you use <pre> to layout a grid of data instead of using a <table>,
this would be problematic. Of course, if a table is needed, that would
make it tabular data, not non-tabular data.
If Julie is asking whether surrounding long sections of text data in a
web page with <pre> will make it any more accessible, the answer is
"probably not". Long content in a pre-formatted, mono-spaced font will
likely be more difficult to read. As far as screen readers are
concerned, they do nothing special with the <pre> element. If other
relationships or semantics are being presented through purely visual
text changes, then appropriate markup is probably necessary.
Jared Smith
WebAIM
From: Nathalie Sequeira
Date: Fri, Nov 05 2010 2:30AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hi Julie & welcome,
> Quick question:
> Is the use of the <pre> tag for presenting (non tabular data) content
> accessible?
>
A short illustration:
Recently, I had the case of a (short!) <pre/>'d section of text and
after seeing it in action - how it will not reflow when enlarged
(causing ugly overlaps on sidebars & horizontal scroll when moving
towards 200% enlargement on a 1024x768px resolution), decided against
using it.
And a short thought on the matter:
"Accessible" is a very relative term and per se can mean anything from
being able to access the content at all (e.g. text graphics without
alternatives for vision impaired/blind users), compliance with standards
or legal requirements, all the way to a pleasant, easy user experience
for all.
So it also depends on what you're aiming for :)
HTH
Nathalie
From: Simius Puer
Date: Fri, Nov 05 2010 5:36AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hi Jared
Ha ha, I think you are taking my comments a little too-much out of context
by removing the first part of my sentence - it was after all a
*very*contextual remark and mirrors pretty closely what you have
concluded in your
final paragraph.
I was working off the basis that these were "quite lengthy legal documents"
as mentioned in the original enquiry, not a short bit of text which likely
contains no structural elements. Having said that, I have to disagree with
you and point out that my my email *does *contain *some* structural data
(who it's from, date etc) even if is taken for granted and I didn't take any
active part in putting it there.
I don't believe Julie was asking "whether surrounding long sections of text
data in a web page with <pre> will make it any more accessible" as she has
already stated: "I have many documents ... that *are currently being
presented in this manner*". Unless I have read that wrong what I am
envisioning is something like:
<pre>
a long and complex legal document which common sense tells us will contain
headings and paragraphs and possibly even ordered and unordered lists and
other basic structural elements
</pre>
If this is the case I don't think you would disagree that it really ought to
be marked up correctly.
I was also trying not to focus too closely on "is this technically compliant
or not" as this misses part of the bigger picture and is one of the reasons
many people have been criticised in the past for taking a "tick-box"
approach to accessibility. To that extent I would also have to say I have
grave reservations about your statement "if other relationships or semantics
are being presented through purely visual text changes, then appropriate
markup is probably necessary" - I would argue that there is not "probably"
about it ;]
Hope you are keeping well.
From: Julie Dodd
Date: Fri, Nov 05 2010 8:36AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hello Andrew,
Thank you for your reply and welcome.
In my haste, I might not have been exactly clear in my original email.
We have legal data that is currently being generated in an HTML file,
but is displayed entirely with the <pre> tag. The headings are
rendered in caps with double spacing between paragraphs. There are
multi-level outlines that are of course, not rendered with list tags.
I have been advocating for proper markup of this content in order for
it to be navigable for assistive technologies (as well as improved
legibility for sighted users). As you pointed out, it will be a
significant undertaking. I want to be sure I am accurate in my
position before advocating for this effort.
Regards,
Julie
On Nov 4, 2010, at 3:28 PM, Simius Puer wrote:
> Hi Julie
>
> Welcome to the list.
>
> The short answer is: yes, it is required.
>
> If I am correct in interpreting what you are saying, you essentially
> have no
> mark-up other than <pre> in the entire document - in that case,
> whilst the
> document is not "inaccessible" as such, it contains absolutely no
> semantic
> mark-up and can not be considered accessible.
>
> I would go beyond that to say that the presentation of the document
> might
> also prove problematic for those with no disabilities as there is
> little to
> guide the user as to the hierarchy of the document - so this becomes a
> matter of usability rather than just accessibility.
>
> Whilst you could argue that all the content is 'technically'
> accessible (in
> a very tick-box approach) that doesn't make it genuinely so...and I
> know a
> great many people on this list would even disagree with the first
> part of
> what I've said there ;]
>
> If you think you have great many lengthy legal documents to deal
> with all I
> can say is that I worked as part of a team on http://
> www.opsi.gov.uk/ who a
> few years back added a great many back-years catalogue of UK
> legislation to
> their on-line catalogue. Not only did much of the data have to be
> imported
> from scratch, but the work on the XML schema and HTML/CSS mark-up to
> be used
> was very extensive....legal documents rarely have less than the 6
> levels of
> heading provided in HTML for a start ;]
>
> Best regards
>
> ___
From: deborah.kaplan
Date: Fri, Nov 05 2010 8:48AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Julie,
From the way you describe the legal data, it's possible that
adding semantic markup might be relatively simple to automate,
especially if you have anyone in the office who is skilled in
regular expressions. Recognizing the double spacing surround
paragraphs, lines in all caps are headings, that's fairly
straightforward. If your multi-level outlines are consistently
formatted, that's also a place for conversion to semantic markup
can be automated.
I don't think Microsoft Word's search and replace regular
expression capability is powerful enough, but it ought to be
fairly simple in Perl, or even in an editor such as vim or emacs.
Then, of course, a human would have to review it to make sure
that all the heading levels were correct and that all of the
preformatted text had been consistent.
-Deborah
From: Jared Smith
Date: Fri, Nov 05 2010 8:54AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
On Fri, Nov 5, 2010 at 8:47 AM, < = EMAIL ADDRESS REMOVED = > wrote:
> From the way you describe the legal data, it's possible that
> adding semantic markup might be relatively simple to automate,
> especially if you have anyone in the office who is skilled in
> regular expressions.
Yep! This should be something to look into.
At a minimum, I probably would not present this lengthy information
using <pre> due to the many accessibility implications already
discussed. Using <pre> will only make it less accessible.
Jared
From: Julie Dodd
Date: Fri, Nov 05 2010 9:00AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hello Mike,
I am also in the US and Section 508 is our primary concern, too. You
make an excellent point regarding "equivalent facilitation." I found
this in the buildings and facilities checklists, does this also apply
to the internet?
Thank you,
Julie
On Nov 5, 2010, at 7:44 AM, Langum, Michael J wrote:
> I am mostly concerned with Section 508. I don't believe there is
> any explicit requirement for semantic markup (aside from tables).
> But section 508 DOES require "equivalent facilitation." I think you
> could (and should) make the argument that not explicitly marking up
> headers and lists means that there is not "equivalent facilitation."
>
> -- Mike
>
>
>
From: Julie Dodd
Date: Fri, Nov 05 2010 9:06AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Thank you Deborah for the suggestion. There are some complexities to
the content that will most likely preclude regular expressions, but I
will make the suggestions to developers.
I agree, Jared. I am going to make my recommendation to properly
markup this content.
Thank you everyone for your thoughtful responses. I do appreciate it!
Julie
>> From the way you describe the legal data, it's possible that
>> adding semantic markup might be relatively simple to automate,
>> especially if you have anyone in the office who is skilled in
>> regular expressions.
>
> Yep! This should be something to look into.
>
> At a minimum, I probably would not present this lengthy information
> using <pre> due to the many accessibility implications already
> discussed. Using <pre> will only make it less accessible.
>
> Jared
From: Simius Puer
Date: Fri, Nov 05 2010 9:12AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hi Julie
You weren't explicit, but that was pretty much what I expected - partially
from experience having seen something similar before.
At least you have electronic versions to work from - I have been faced with
print only material in the past so that is a big step.
Deborah is quite right - if the documents are fairly consistent you can
write regular expressions in PERL (a number of HTML editors also support
their own flavour of RegEx so don't panic if you don't have PERL developers)
to automate a huge amount of the work, but you will always need a human to
sense-check what comes out. On bulky documents this can save weeks or
months of work.
@ Mike, Section 508 is based largely around the WCAG and semantic mark-up is
at the very core of those. You won't find anything that explicitly says
"you may not write your entire document inside a <pre> tag but I think that
would be pretty much taken for granted given all the other guidelines. Even
if it (and I entirely doubt it - see below) conformed it would still be an
example of tic-box conformity, not genuine accessibility.
Section 508 (d) "Documents shall be organized so they are readable without
requiring an associated style sheet". Now that does not explicitly state
you need semantic mark-up but it is certainly implied.
From: Simius Puer
Date: Fri, Nov 05 2010 9:24AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hello again
I looked a little further and found what I was looking for:
*Section 508*
(k) *A text-only page*, with equivalent information or functionality, *shall
be provided* to make a web site comply with the provisions of this part, *when
compliance* *cannot be accomplished in any other way*. The content of the
text-only page shall be updated whenever the primary page changes.
*Pass*
A text-only version is created only when there is no other way to make the
content accessible or when it offers significant advantages over the main
version for certain disability types.
*Fail*
A text-only version is provided when the main version is not accessible, but
could be made fully accessible.
....put all the bits together and it does require semantic mark-up.
Hope that helps clarify the case regarding Section 508 and makes your case
that bit stronger.
From: Langum, Michael J
Date: Fri, Nov 05 2010 9:30AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
I am mostly concerned with Section 508. I don't believe there is any explicit requirement for semantic markup (aside from tables). But section 508 DOES require "equivalent facilitation." I think you could (and should) make the argument that not explicitly marking up headers and lists means that there is not "equivalent facilitation."
-- Mike
From: Julie Dodd
Date: Fri, Nov 05 2010 9:36AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Thank you again, Andrew!
Your reply is very much appreciated.
Julie
On Nov 5, 2010, at 8:20 AM, Simius Puer wrote:
> Hello again
>
> I looked a little further and found what I was looking for:
>
> *Section 508*
>
> (k) *A text-only page*, with equivalent information or
> functionality, *shall
> be provided* to make a web site comply with the provisions of this
> part, *when
> compliance* *cannot be accomplished in any other way*. The content
> of the
> text-only page shall be updated whenever the primary page changes.
>
> *Pass*
>
> A text-only version is created only when there is no other way to
> make the
> content accessible or when it offers significant advantages over the
> main
> version for certain disability types.
>
> *Fail*
>
> A text-only version is provided when the main version is not
> accessible, but
> could be made fully accessible.
>
>
> ....put all the bits together and it does require semantic mark-up.
>
> Hope that helps clarify the case regarding Section 508 and makes
> your case
> that bit stronger.
>
>
>
From: Simius Puer
Date: Fri, Nov 05 2010 9:45AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
No problem. That's what this list is all about - I only wish I'd known
about it years ago!
Just shout if you need any further help.
Best regards
From: Jared Smith
Date: Fri, Nov 05 2010 9:51AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
On Fri, Nov 5, 2010 at 9:20 AM, Simius Puer < = EMAIL ADDRESS REMOVED = > wrote:
> *Fail*
>
> A text-only version is provided when the main version is not accessible, but
> could be made fully accessible.
>
> ....put all the bits together and it does require semantic mark-up.
I think this is quite a stretch. Using plain text is not the same as
providing a text-only version as an alternative to something that is
not accessible. If your suggestion were true, then plain-text e-mail
and any other text lacking markup (all .txt documents, for example)
would violate Section 508. I've never heard it interpreted this way.
There's nothing in Section 508 that requires heading markup. 508 does
require semantic markup for table headers, form labels, and frame
titles. Michael noted that equivalent facilitation may require heading
markup, but I think this is also a bit of a stretch.
Without additional markup the data Julie is discussing won't be
inaccessible and it probably will be Section 508 compliant (though not
WCAG conformant). But it will be much more accessible with the
appropriate markup.
Jared
From: Susan Grossman
Date: Fri, Nov 05 2010 10:03AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
On Fri, Nov 5, 2010 at 7:44 AM, Langum, Michael J < = EMAIL ADDRESS REMOVED = >wrote:
> I am mostly concerned with Section 508. I don't believe there is any
> explicit requirement for semantic markup (aside from tables). But section
> 508 DOES require "equivalent facilitation." I think you could (and should)
> make the argument that not explicitly marking up headers and lists means
> that there is not "equivalent facilitation."
>
> -- Mike
>
>
In WCAG 2.0, and the working 508 refresh, I think that Section 508 22(d) &
the "equivalent" WCAG 2.0 section 6.1 specifically state that semantic
mark-up is required "to designate headings"
Susan
From: Julie Dodd
Date: Fri, Nov 05 2010 10:15AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Hello Susan!
> In WCAG 2.0, and the working 508 refresh, I think that Section 508
> 22(d) &
> the "equivalent" WCAG 2.0 section 6.1 specifically state that semantic
> mark-up is required "to designate headings"
>
> Susan
I found that information here, too: http://508-255-refresh.trace.wisc.edu/content/5032-information-structure-and-relationships
Julie
From: Simius Puer
Date: Fri, Nov 05 2010 10:36AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Jared
I quite agree, it really is not as black and white and it should be. It
could be, and therefore often is, interpreted really badly, especially as a
lot of the time it refers to a "visual equivalent".
A document *with* structure (you keep referring to emails, but emails are
typically nothing more than simple paragraphs) should be marked up with the
structure in the first place. And yes, if I send complex emails I do
actually apply headings - not for accessibility per se, but simple
usability.
You shouldn't really argue that a document that is visually dire because of
a total lack of mark-up can be equally as bad and still be accessible as a
result of making it plain text. This might technically be "compliant" but
it would only be taking the most ill-conceived tick-box approach.
Sadly the refresh adds little in the way of clarification:
"*503.2 Information, Structure, and Relationships.* Information, structure,
and relationships presented visually to the user shall be programmatically
determinable or be available in text."
The intent of this provision is to ensure that information and relationships
*that are implied by visual or auditory formatting* are preserved when the
presentation format changes.
...sadly if there is no structure implied to begin with then the clause does
not technically apply. However, if you do not assume that there is
*some*common sense applied at
*some *level and that documents will have some semantic mark-up then you
could argue: sure, go use the <pre> tag for anything you find too
challenging to mark-up properly to begin with.
The assumption is that there is *some *indication of structure to begin with
- an exceptionally dangerous assumption if you ask me.
It does get better though. The refresh also adds:
"The sub provisions under *503.2 *are not an exhaustive list of information,
structure, and relationships that might be presented to an end-user."
One of which is:
"*503.2.3 Section Headings.* When content is divided into sections, section
headings shall be programmatically determinable."
However (and I really hate reading these things with my legal hat on) you
could argue that the sub-provision only applies when, according to the main
provision: "information and relationships ... are implied by visual or
auditory formatting"
At the end of the day would you honestly try to argue in a court of law that
a lengthy legal document written inside a <pre> tag constitutes as
accessible? Would you even hint at advocating that approach to the people
on this list?
From: Jared Smith
Date: Fri, Nov 05 2010 10:54AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
On Fri, Nov 5, 2010 at 10:19 AM, Simius Puer wrote:
> At the end of the day would you honestly try to argue in a court of law that
> a lengthy legal document written inside a <pre> tag constitutes as
> accessible? Would you even hint at advocating that approach to the people
> on this list?
Of course I wouldn't. And I haven't. I could, however, easily make an
argument in a court of law that such a document is Section 508
compliant. There's a big difference between "accessible" and
"compliant".
You have suggested several times that such a document is automatically
"inaccessible" - a word that suggests a total inability to access. I'm
arguing that most anybody could read the content of the document and
generally make sense of it. They could access it. However, with
headings, it would be much more accessible, much further along the
continuum of accessibility.
Because something is non-compliant does not mean it's "inaccessible" -
no more so than a document that is fully compliant is automatically
"accessible" to everyone. Calling something "accessible" or
"inaccessible" is useless without quantifying how or to whom that
thing is accessible or inaccessible.
Jared
From: Hoffman, Allen
Date: Fri, Nov 05 2010 11:36AM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Delivery of such content without ability to navigate headings would not
meet WCAG 2.0 requirements, however, such content might possibly meet
Section 508 compliance standards. Use of CAPS for heading delineation
is not sufficient for products to interpret correctly. So, "just say
no" would be my answer to if this was accessible content.
Automated conversion of straight textual material to marked up format
should not be time consuming in anyway, so I'd push hard on this if it
were I.
From: Hoffman, Allen
Date: Fri, Nov 05 2010 12:48PM
Subject: Re: use of <pre> tag
← Previous message | Next message →
The logic chain here doesn't mean current Section 508 standards require
HTML mark up for inline textual information, however, As my previous
email indicated, such content can meet existing standards, it is not
likely to keep meeting accessibility standards for very long. Even if
you had top and bottom of page navigation with skip-navigation links to
start of pre tags it would be 508 compliant in principle, but in
practice its bad.
At the Department of Homeland Security we do not fail such content for
section 508 compliance. It is, again, not good practice however.
From: Jukka K. Korpela
Date: Fri, Nov 05 2010 3:42PM
Subject: Re: use of <pre> tag
← Previous message | Next message →
Simius Puer wrote:
> Hi Jared
This is a public discussion list. Please keep personal remarks to personal
email.
> Ha ha, I think you are taking my comments a little too-much out of
> context
You are not giving any context. Sorry, you are just boring.
> I was working off the basis that these were "quite lengthy legal
> documents" as mentioned in the original enquiry, not a short bit of
> text which likely contains no structural elements.
Please do not hesitate to post again to the list whenever you have something
substantial to say, but hopefully not earlier.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
From: Jared Smith
Date: Fri, Nov 05 2010 5:03PM
Subject: Re: use of <pre> tag
← Previous message | No next message
On Fri, Nov 5, 2010 at 3:39 PM, Jukka K. Korpela wrote:
> This is a public discussion list. Please keep personal remarks to personal
> email.
> Please do not hesitate to post again to the list whenever you have something
> substantial to say, but hopefully not earlier.
Jukka- (<-- See what I did just there?)
This list is intended to be a friendly place for constructive and
friendly conversation. We can certainly disagree at times, but all are
welcome to post on-topic messages. Your post was neither constructive,
friendly, or on-topic. You do not moderate the list. I do. Please
consider this a constructive and friendly warning.
Jared Smith
WebAIM.org