First time here? Check out the FAQ!
1

HTML Tags in titles getting eaten <fixed/>

It seems that HTML tags in titles are swallowed instead of escaped to HTML entities.

Clarification: I do not mean allowing HTML in TITLE tags, but converting < and > into their respective HTML entities &lt; and gt;. At the moment, if you type in Hello <World>, the <World> part will be completely swallowed and the result will be Hello. The end result, in my opinion, should be Hello &lt;World&gt; I do not think any real HTML should be allowed in titles.

Evgeny's avatar
13.2k
Evgeny
updated 2010-05-04 18:55:53 -0600
Pekka's avatar
590
Pekka
asked 2010-05-01 13:21:22 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Hmm, tags in in titles - not supported yet. Should we? - I'm not sure.

I know Mathoverflow people like to insert equations into titles - but they do it using a non-html trick, as far as I know.

If we do - it would have to be a limited set of tags - you wouldn' want to have <div> <iframe> <table> and stuff like that.

What tags to you want to allow in title?

edit oh, I see what you mean - would it make sense to have input validation just reject titles with html tags rather than silently drop them? We sure can convert tags to entities - but the text would look weird an somebody might think that the site is broken after looking at &lt;b&gt

edit 2 ok convinced me - it's a bug dammit :)!

edit 3 fixed in the repository - will deploy tomorrow

Evgeny's avatar
13.2k
Evgeny
updated 2010-05-03 23:48:52 -0600, answered 2010-05-01 13:36:54 -0600
edit flag offensive 0 remove flag delete link

Comments

@Evgeny check out my update.
Pekka's avatar Pekka (2010-05-02 02:43:24 -0600) edit
@Evgeny mm, I think the entities could be displayed as `<` `>` in the actual title, they just would have to be encoded internally so they're not rendered.
Pekka's avatar Pekka (2010-05-02 13:01:28 -0600) edit
@Pekka hey, you're right and I'm slow! Of course - why not be able to ask questions about html tags.
Evgeny's avatar Evgeny (2010-05-02 13:12:31 -0600) edit
I'll take care of this soon.
Evgeny's avatar Evgeny (2010-05-02 13:13:13 -0600) edit
@Evgeny we need those shiny red "status-xxx" badges from meta.stackoverflow.com! :)
Pekka's avatar Pekka (2010-05-04 01:27:25 -0600) edit
add a comment see more comments