The Mudcat Café TM
Thread #5225   Message #29810
Posted By:
01-Jun-98 - 08:34 PM
Thread Name: line breaks: how to do it
Subject: RE: line breaks: how to do it
Joe, First of all, the HTML parser (the gadget that reads the HTML commands and makes a program with instructions what to do with it) ignores extra spaces. It is up to the program that displays the text to add the spcaces.

Secondly, If you write "<BR>" The parser sees the first "&" and says "OK, that is the name of a symbol." However, it doesn't know where the name ends so it thinks that the symbol you are trying to write is "ltBR" because it knows when it sees the next "&" which tells it you are starting a new symbol name. Some programs would give an error message at this point saying it never heard of such a symbol ast "ltBR", but the default behaviour of HTML parsers is to not try to process erroneous commands, but to just print them literally. If you stop and think about it, that makes sense. The person using the browser wouldn't want your error messages.

Finally, Every command in HTML has a start tag and an end tag. For example "<" is a start tag for formatting commands. Now "&" is the start tag for the name of a symbol. The end tag for the symbol is a comma, but for convenienc, HTML will accept a space. This means you can't have names of symbols with a space in them, but we all live with that anyway. So when HTML reads "< " it reads start a symbol that symbol is "lt" the space tells me where to end. Then it gobbles up the space and continues its reproducing of text.

Let me know if you want more

Murray