Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to display HTML as text?

How to display HTML as text?
Thread Tools
Mac Elite
Join Date: Aug 2002
Location: Connecticut
Status: Offline
Reply With Quote
Feb 15, 2004, 03:23 PM
 
How can I make HTML display as text in web browsers, such as the <XMP> tag which is apparently obsolete now?

MacThemes.net Editor in Chief
     
Mac Elite
Join Date: Nov 2003
Location: Minnesota
Status: Offline
Reply With Quote
Feb 15, 2004, 04:12 PM
 
You can always use &gt; and &lt; for > and < respectively.
     
Mac Elite
Join Date: Oct 2000
Location: Baltimore, MD
Status: Offline
Reply With Quote
Feb 15, 2004, 04:16 PM
 
<code></code>

should still work... iirc.
     
Grizzled Veteran
Join Date: Dec 2000
Location: Málaga, Spain, Europe, Earth, Solar System
Status: Offline
Reply With Quote
Feb 16, 2004, 12:26 AM
 
Code:
<![CDATA[ <tags> ]]>
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Feb 16, 2004, 08:47 AM
 
You could modify the web server mime type to return a content-type of text/plain instead of text/html. That way you don't modify the original content with wrapper tags.

This is a good solution if you're looking to add a "view source" option. Just have a PHP page or CGI that sets the content type and dumps the page as-is.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Mac Elite
Join Date: Aug 2002
Location: Connecticut
Status: Offline
Reply With Quote
Feb 16, 2004, 09:51 AM
 
Thanks, I used the &gt; and &lt; things, and it worked great. <code> and <pre> did not turn off rendering, it only made the text (or links) formatted in simple, non fancy fonts.

MacThemes.net Editor in Chief
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:59 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2