Newline character in HTML
How often in practice will you find a newline character in the middle of HTML?
Just tested in my browser - newline characters within HTML are ignored and the output is displayed correctly.
I am asking, because I would like to introduce a small domain specific language that works with the newline character as a trigger (outside of HTML, using the off-side-rule).
Now, if it is regarded as perfectly normal practice to place the newline anywhere within HTML, I would probably need regular expressions to find out the boundaries of the blocks.
My research has indicated, that especially in a TEXTAREA, a newline character is perfectly normal.
Thanks in advance
I use new line characters to make the HTML code more readable, hence easier to maintain. So they are placed liberally in every web page I have written. I think that is quite normal.
Thanks, that's what I thought
What's the easiest way then to detects the boundaries of HTML tags/blocks?
Use a parser.
Originally Posted by
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
I suppose, I could instead introduce the custom delimiter "\n|"
i.e. newline + "|".
Do you think that that would be unique, keeping in mind that the user is self-responsible anyway, as soon as (s)he includes the .js?
How often does "\n|" occur in everyday HTML?
Why do you need to introduce a new line character in HTML? What is wrong with </p> </li> etc... that perform an implicit line break. Or <br> which performs an explicit one???
Nothing wrong with them. They will not be replaced or touched at all...
Would like to introduce a small DSL(domain specific language) between the HTML like:
|command1 argument1 argument2
|command2 argument1 argument2 argument3
That's why I'm asking, how often you think the "\n|" will occur in practice?
(please keep in mind, that the user of the DSL will be self-responsible anyway)
I think that the whole idea is crackpot. I can think of a thousand reasons not to re-invent the wheel, and none in favour. Just because something is technically possible and terribly clever does not make it sensible to do. Remember, someone has to maintain your code. Even if that is you, I suspect that you will curse your own stupidity for introducing non-standard elements that do nothing more than the language does anyway!
Normal HTML on the page will be untouched.
The user is self-responsible if using the DSL.
I have responsibility between releases to make sure,
that the release is bug-free and coherent.
Let's keep the focus on the actual simple question -
what about the master delimiter: "\n|" ?
How often does it occur in normal HTML?
Users Browsing this Thread
There are currently 1 users browsing this thread.
(0 members and 1 guests)