Ask Your Question
1

HTML Tags in titles getting eaten <fixed/>

asked May 01 '10

Pekka gravatar image Pekka
500 19 26 34

updated May 04 '10

Evgeny gravatar image Evgeny flag of Chile
6665 31 49 95
http://askbot.org/

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.

1 Answer

Sort by ยป oldest newest most voted
1
Pekka has selected this answer as correct

answered May 01 '10

Evgeny gravatar image Evgeny flag of Chile
6665 31 49 95
http://askbot.org/

updated May 03 '10

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

link

Comments

@Evgeny check out my update. Pekka (May 02 '10)
@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 (May 02 '10)
@Pekka hey, you're right and I'm slow! Of course - why not be able to ask questions about html tags. Evgeny (May 02 '10)
I'll take care of this soon. Evgeny (May 02 '10)
@Evgeny we need those shiny red "status-xxx" badges from meta.stackoverflow.com! :) Pekka (May 04 '10)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: May 01 '10

Seen: 917 times

Last updated: May 04 '10