html

There are 4 entries for the tag html

New Line Quirk with HTML TextArea

Pop quiz. What would you expect these three bits of HTML to render? <!-- no new lines after textarea --> <textarea>Foo</textarea> <!-- one new line after textarea --> <textarea> Foo</textarea> <!-- two new lines after textarea --> <textarea> Foo</textarea> The fact that I’m even writing about this might make you suspicious of your initial gut answer. Mine would have been that the first would render a text area with “Foo” on the first line, the second with it on the second line, and the third with it on the third line. In fact, here’s what it renders using Firefox 3.0.3....

HTML Stripping Challenge

UPDATE: I added three new unit tests and one interesting case in which the three browser render something differently. Well I’m back at it, but this time I want to strip all HTML from a string. Specifically: Remove all HTML opening and self-closing tags: Thus <foo> and <foo /> should be stripped. Remove all HTML closing tags such as </p>. Remove all HTML comments. Do not strip any text in between tags that would be rendered by the browser. This may...

The Landmine of Parsing HTML and Stripping HTML Comments

A while ago I wrote a blog post about how painful it is to properly parse an email address. This post is kind of like that, except that this time, I take on HTML. I’ve written about parsing HTML with a regular expression in the past and pointed out that it’s extremely tricky and probably not a good idea to use regular expressions in this case. In this post, I want to strip out HTML comments. Why? I had some code that uses a regular expression to strip comments from HTML, but found one of those feared...

Browser Choice and Voting Online

In my last post, I joked that the reason that someone gave me all 1s in my talk was a misunderstanding of the evaluation form. In truth, I just assumed that someone out there really didn’t like what I was showing and that’s totally fine. It was something I found funny and I didn’t really care too much. But I received a message from someone that they tried to evaluate the session from the conference hall, but the evaluation form was really screwy on their iPhone. For example, here’s how it’s supposed to look in IE. ...