Re: Reanimate <xmp>

Hello again,

I think a newbie can understand that there are two different  
technically principles of preformatted text.

1. The <pre> principle
   - preserves whitespace
   - allows markup as usual
2. The <xmp> principle
   - peserves whitesace
   - displays any HTML-like markup as text
   - doesn't allow "</xmp" inside

In general, we (the HTML WG) should look beyond the edge of our  
dogfood plate. <xmp> fits for much more than HTML content.

j.j.



Thomas Broyer <t.broyer@gmail.com>: hodd gsachd:

>
> 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 18:03:15 UTC