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.
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.
“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
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???
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|" ?
Bookmarks