Curiosity [ ] methods in html

R

richard

Anyone have a site that explains how to use the shortcut brackets?
Trying to google this gives me everything I don't want to know.
 
J

Jonathan N. Little

richard said:
Anyone have a site that explains how to use the shortcut brackets?
Trying to google this gives me everything I don't want to know.

HTML doesn't have *methods*
 
D

Doug Miller

Anyone have a site that explains how to use the shortcut brackets?

What on earth are you talking about?
Trying to google this gives me everything I don't want to know.

Perhaps if you Googled on something that makes sense...
 
R

richard

What on earth are you talking about?


Perhaps if you Googled on something that makes sense...


I used to have an ascii art program that produced the output using
nothing but the []. Some one said this was a shortcut. But I could
never find any explanation of it elsewhere.
 
D

Doug Miller

What on earth are you talking about?


Perhaps if you Googled on something that makes sense...


I used to have an ascii art program that produced the output using
nothing but the []. Some one said this was a shortcut. But I could
never find any explanation of it elsewhere.

Sorry, richard, I have no idea what you're talking about.

And what does this have to do with HTML?
 
L

Lars Eighner

the said:
What on earth are you talking about?


Perhaps if you Googled on something that makes sense...

I used to have an ascii art program that produced the output using
nothing but the []. Some one said this was a shortcut. But I could
never find any explanation of it elsewhere.

The reason everyone is confused by your question is that neither [ nor
] have any special significance in HTML. They are just the open and close
square bracket characters. [] is just those characters. In HTML,
ASCII art should go in the PRE element:

<pre>

ASCII art goes here.

</pre>

The problem here is, characters in the art like &<> need to be changed to
&amp; &lt; and &gt; to guarantee this will work. If you use anything other
than the original 7-bit ASCII characters, they must be in the character set
of your HTML document, or they too must be encoded as character entity
references.

You may mean CDATA. This is not HTML but a SGML construct which may or may
not be supported in various browsers. That looks like this

<![CDATA[
A bunch of ASCII art goes here
]]>

CDATA means "character data" and here &<> do not need to be escaped. But in
the past support for this SGML construct has been spotty, so this may work
in some browsers, but not in others. Some browsers may ignore it, and
others may do something entirely broken with it.

There are also various ways to insert a file of ascii art into an HTML
document, but this does not get around the basic problem which is that
the special charaters &<> need to be encoded as character entity references
(as above) to appear naked in an HTML document. If you use a preprocessor
such as PHP to do this, encoding the special characters can be done with a
simple function.
 
J

Jonathan N. Little

Doug said:
I used to have an ascii art program that produced the output using
nothing but the []. Some one said this was a shortcut. But I could
never find any explanation of it elsewhere.

Sorry, richard, I have no idea what you're talking about.

And what does this have to do with HTML?

Absolutely nothing, but it never stops him.
 
D

dorayme

Lars Eighner said:
In our last episode, <[email protected]>, the
lovely and talented richard broadcast on alt.html:
.. ..

The reason everyone is confused by your question is that neither [ nor
] have any special significance in HTML. They are just the open and close
square bracket characters. [] is just those characters. In HTML,
ASCII art should go in the PRE element:

<pre>

ASCII art goes here.

</pre>

The problem here is, characters in the art like &<> need to be changed to
&amp; &lt; and &gt; to guarantee this will work.

....

In a text editor with GREP powers of Search and Replace. <([^<>]+)> to
\&lt;\1\&gt; does a lot (but not all) of what is needed for mark-up
display in HTML. Just make yourself a few little GREP replacement
patterns and if you get cute, you can combine them all into one pattern.
 
R

richard

Lars Eighner said:
In our last episode, <[email protected]>, the
lovely and talented richard broadcast on alt.html:
.
Anyone have a site that explains how to use the shortcut brackets?
.

The reason everyone is confused by your question is that neither [ nor
] have any special significance in HTML. They are just the open and close
square bracket characters. [] is just those characters. In HTML,
ASCII art should go in the PRE element:

<pre>

ASCII art goes here.

</pre>

The problem here is, characters in the art like &<> need to be changed to
&amp; &lt; and &gt; to guarantee this will work.

...

In a text editor with GREP powers of Search and Replace. <([^<>]+)> to
\&lt;\1\&gt; does a lot (but not all) of what is needed for mark-up
display in HTML. Just make yourself a few little GREP replacement
patterns and if you get cute, you can combine them all into one pattern.


Thank you.
I know that at least one web site I had seen the [ ] mentioned but no
real details of how to use them were ever given.
 
L

Lars Eighner

In our last episode,
the lovely and said:
In our last episode, <[email protected]>, the
lovely and talented richard broadcast on alt.html:
.
Anyone have a site that explains how to use the shortcut brackets?
.

The reason everyone is confused by your question is that neither [ nor
] have any special significance in HTML. They are just the open and close
square bracket characters. [] is just those characters. In HTML,
ASCII art should go in the PRE element:

<pre>

ASCII art goes here.

</pre>

The problem here is, characters in the art like &<> need to be changed to
&amp; &lt; and &gt; to guarantee this will work.

In a text editor with GREP powers of Search and Replace. <([^<>]+)> to
\&lt;\1\&gt; does a lot (but not all) of what is needed for mark-up
display in HTML. Just make yourself a few little GREP replacement
patterns and if you get cute, you can combine them all into one pattern.

However you do this, perl one-liner(s), search-and-replace functions, etc.,
*always* do & first.
 
D

dorayme

Ben C said:
The reason everyone is confused by your question is that neither [ nor
] have any special significance in HTML. They are just the open and close
square bracket characters. [] is just those characters. In HTML,
ASCII art should go in the PRE element:

<pre>

ASCII art goes here.

</pre>

The problem here is, characters in the art like &<> need to be changed to
&amp; &lt; and &gt; to guarantee this will work.

...

In a text editor with GREP powers of Search and Replace. <([^<>]+)> to
\&lt;\1\&gt; does a lot (but not all) of what is needed for mark-up
display in HTML. Just make yourself a few little GREP replacement
patterns and if you get cute, you can combine them all into one pattern.

Or use recode utf8..h4.

Or, to be on the safe side, you could just replace _every_ character in
the ASCII art with an &# thing.

A giant GREP pattern... mmm...
 
H

Harlan Messinger

richard said:
Thank you.
I know that at least one web site I had seen the [ ] mentioned but no
real details of how to use them were ever given.

You've also seen websites with "e", "W", "8", "@", and "$", but, like
"[" and "]", they are just characters, they have nothing special to do
with HTML, they aren't "shortcuts" for anything, and there are no
details underlying their "use".
 
N

Neredbojias

richard said:
Thank you.
I know that at least one web site I had seen the [ ] mentioned but
no real details of how to use them were ever given.

You've also seen websites with "e", "W", "8", "@", and "$", but, like
"[" and "]", they are just characters, they have nothing special to
do with HTML, they aren't "shortcuts" for anything, and there are no
details underlying their "use".

Bet you never saw website in Klingon...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top