Tags:
create new tag
view all tags

Bug: Instead of suggesting PRE tag try suggesting XMP tag (or suggest both)

In various TWiki examples it's stated that users can use the html tag,

  • {PRE} this is unformatted text {/PRE}

kind of tag. Well, there's a little known tag called XMP (left over from HTML 1.0 I think!) which works even better (depending on what you want):

  • PRE will not format whitespace, but will process html inside the PRE
  • XMP will not format whitespace and will also not process html inside the XMP

Thus,

  • PRE is good for preformatted text,
  • XMP is great for snippets of source code

Test case

  • For example I usually use XMP to quote source code. Then I don't have to worry about the pointy brackets in my source code messing up the browser. Example:

here I can put lots of &lt; and &gt; and not worry because the browser skips everything including internal markup like <b>bold</b> or <i>italic</i>

  • here I will put similar text as above but in PRE and notice that the html is interpretted.
      here I can put lots of < and > and I might worry because the 
    browser may interpret things including internal markup like bold or italic
     

-- TWikiGuest - 28 Dec 2001

<xmp> is not a valid HTML tag, see 4.0 element list at http://www.w3.org/TR/1998/REC-html40-19980424/index/elements.html

TWiki actually has the <verbatim> tag, it does what you want to accomplish with the XMP tag.

-- PeterThoeny - 31 Dec 2001

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2002-01-01 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.