W3C home > Mailing lists > Public > public-html@w3.org > December 2007

Re: Reanimate <xmp>

From: Thomas Broyer <t.broyer@gmail.com>
Date: Mon, 10 Dec 2007 15:11:37 +0100
Message-ID: <a9699fd20712100611i14d5b9cey8e1ab71cdb60f9a6@mail.gmail.com>
To: public-html@w3.org

2007/12/10, j.j.:
> Thomas Broyer hodd gsachd:
> > That being said, I'm really not convinced that XMP is needed at all:
> > you only have to do a search/replace for & to &amp; (you're already
> > doing it anyway) and < to &lt; (other characters don't need any
> > special treatment).
> It's a great benefit ecpecially (but not only) for inexperienced
> authors.

That's where our opinions diverge.

Newbie: how do I show some HTML code in an HTML page? If I just
copy/paste my code, it's interpreted by the browser. I.e. I don't want
bold text, I want the string <strong> to appear.

You: enclose your HTML code in <xmp> and </xmp> tags

Me: search/replace all your < into &lt;.
Now, you should also enclose the whole thing inside <code>, and if you
want your spaces and line breaks to be preserved, use a <pre> (you
might already know both).

> And author's requirements have currently higher priority for
> us than theoretical purity.
> <http://www.w3.org/TR/html-design-principles/#priority-of-constituencies>

It's not a matter of theoretical purity:

Newbie: cool! now how can I make some parts bold, or blue? It's for a
step-by-step tutorial and I want to put in relief the changes from one
example to the other.

You: er, you can't, at least with <xmp>...

Me: just use markup within your <pre><code>. (actually, I doubt the
newbie would have even asked, he probably would have found the
solution himself; with xmp, he would have been disappointed surely)

Thomas Broyer
Received on Monday, 10 December 2007 14:11:44 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:28 UTC