Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Print html code verbatim
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
danielsbrewer
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 135
Location: Epsom, UK

PostPosted: Wed May 18, 2005 8:38 am    Post subject: Print html code verbatim Reply with quote

I have come across a situation where I want to display some html code on my blog. The problem is that if I just put it straight in then it tries to interpret it.

Is there any html tags that will stop the code being processed so that the code is actually displayed?
Back to top
View user's profile Send private message
TrueDFX
Retired Dev
Retired Dev


Joined: 02 Jun 2004
Posts: 1348

PostPosted: Wed May 18, 2005 8:57 am    Post subject: Reply with quote

Replace < with &lt; and > with &gt;. So instead of <b>, you write &lt;b&gt;. Some browsers also support the <xmp> (IIRC) tag for this, but that's no (longer?) standard, and of course, you cannot use it to display </xmp>.

(Edit: if you have a & that you wish to display in there somewhere too, replace that with &amp;. That can turn into a nice mess:

<a href="https://forums.gentoo.org/posting.php?mode=editpost&p=2419314">link</a>
isn't valid.
<a href="https://forums.gentoo.org/posting.php?mode=editpost&amp;p=2419314">link</a>
is the correct way.
So to write that literally, you have to put
&lt;a href="https://forums.gentoo.org/posting.php?mode=editpost&amp;amp;p=2419314"&gt;link&lt;/a&gt;
Yes, that's &amp;amp; you see there.)
Back to top
View user's profile Send private message
danielsbrewer
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 135
Location: Epsom, UK

PostPosted: Wed May 18, 2005 9:25 am    Post subject: Reply with quote

Thanks for that, exactly what I needed.
Back to top
View user's profile Send private message
Joe Kinley
n00b
n00b


Joined: 31 May 2003
Posts: 74
Location: Germany

PostPosted: Wed May 18, 2005 10:31 am    Post subject: Reply with quote

Wasn't there once a tag called cite ? Or was it system ?
Dunno... but there was once some tag that just put text in it like it stands there... with empty spaces too
_________________
No matter what, always follow your heart
Back to top
View user's profile Send private message
TrueDFX
Retired Dev
Retired Dev


Joined: 02 Jun 2004
Posts: 1348

PostPosted: Wed May 18, 2005 10:36 am    Post subject: Reply with quote

You're probably thinking of <pre>, but that only treats spaces/tabs/newlines specially (well, not really, but close enough); it doesn't show < and >.
Back to top
View user's profile Send private message
Lifl
n00b
n00b


Joined: 19 Nov 2003
Posts: 64
Location: bremen.de

PostPosted: Wed May 18, 2005 3:02 pm    Post subject: Reply with quote

For me it shows < at least. :)
_________________
Current project: An Open Source Game
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum