By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Make HTML code show up on the web

Share this Question
Share on Google+
7 Replies


P: n/a
Bob wrote:
http://robertlindsay.blogspot.com/20...how-up-on.html
You seem to have missed the built-in solution that exists for this. All
you have to do is substitute "<" (including both the ampersand and
the semicolon) for the less-than ("<") at the beginning of each tag.
Likewise, if you want something like "&lt;" to appear like that on your
page as such instead of as "<", write it as "&amp;lt;" instead. This is
called "escaping" characters that have a special significance when you
want to display them in a non-special way.
Jun 27 '08 #2

P: n/a
Bob
I know, but I hate that. I wanted to try something different.

On Apr 15, 4:32 am, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
Bob wrote:
http://robertlindsay.blogspot.com/20...tml-code-show-...

You seem to have missed the built-in solution that exists for this. All
you have to do is substitute "&lt;" (including both the ampersand and
the semicolon) for the less-than ("<") at the beginning of each tag.
Likewise, if you want something like "&lt;" to appear like that on your
page as such instead of as "<", write it as "&amp;lt;" instead. This is
called "escaping" characters that have a special significance when you
want to display them in a non-special way.
Jun 27 '08 #3

P: n/a
Bob <li************@gmail.comwrites:
On Apr 15, 4:32 am, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
[escape the HTML]

I know, but I hate that. I wanted to try something different.
How do you deal with displaying </textareain HTML code with this
method?

Why do you hate escaping < as &lt; - if it's because it's a pain to
write every time, then use a method for generating the HTML code that
does it automatically.

Escaping also has the advantage that you can do more with the
displayed code. Example:

<p>An image is displayed with &lt;img src="<var>url</var>"
alt="<var>alternative text</var>" <span class="optional">width="<var>w</var>"
height="<var>h</var>"</span>&gt;.</p>

(While not at all necessary, I've also escaped to &gt; in the
displayed code to make it slightly clearer)

--
Chris
Jun 27 '08 #4

P: n/a
On 15 Apr, 12:07, Bob <lindsay.rob...@gmail.comwrote:
http://robertlindsay.blogspot.com/20...tml-code-show-...
That's not about the web, it's about how to post through Blogspot.

As a web technique, where you have direct control over your markup
(even WYSIWYG), it's inappropriate. Badly so. In fairness to the
original author, that's not what he's suggesting it for anyway.
Jun 27 '08 #5

P: n/a
Bob wrote:
[top-posting adjusted]
On Apr 15, 4:32 am, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
>Bob wrote:
>>http://robertlindsay.blogspot.com/20...tml-code-show-...
You seem to have missed the built-in solution that exists for this. All
you have to do is substitute "&lt;" (including both the ampersand and
the semicolon) for the less-than ("<") at the beginning of each tag.
Likewise, if you want something like "&lt;" to appear like that on your
page as such instead of as "<", write it as "&amp;lt;" instead. This is
called "escaping" characters that have a special significance when you
want to display them in a non-special way.

I know, but I hate that. I wanted to try something different.
Please don't top-post, it complicates responses. Please don't
multi-post, I just found myself replying to you again on another
newsgroup before I realized it wasn't the same thread as this one. If
you must, use cross-posting.

As I said in the other location, I don't know why you hate doing it the
built-in, straightforward way and prefer to misrepresent the situation
as a problem to which you couldn't find a solution until you hacked one
out yourself using a complicated work-around with textareas, but that's
your business.
Jun 27 '08 #6

P: n/a
In article <87************@dinopsis.dur.ac.uk>,
Chris Morris <c.********@durham.ac.ukwrote:
Bob <li************@gmail.comwrites:
On Apr 15, 4:32 am, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
[escape the HTML]
I know, but I hate that. I wanted to try something different.

How do you deal with displaying </textareain HTML code with this
method?

Why do you hate escaping < as &lt; - if it's because it's a pain to
write every time, then use a method for generating the HTML code that
does it automatically.
In any good text editor you can save a replacement or GREP pattern and
tell the editor to replace all '<' and '>' s with '&lt;' and '&gt;' for
the selected (highlighted) text. Super quick.

--
dorayme
Jun 27 '08 #7

P: n/a
On 04/15/08 04:39 am, Bob wrote:
I know, but I hate that. I wanted to try something different.
That is how it is done. You opinion of its elegance is irrelevant.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.