Ask Your Question
1

HTML Tags in titles getting eaten <fixed/>

asked 2010-05-01 13:21:22 -0500

Pekka gravatar image

updated 2010-05-04 18:55:53 -0500

Evgeny gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2010-05-01 13:36:54 -0500

Evgeny gravatar image

updated 2010-05-03 23:48:52 -0500

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

edit flag offensive delete link more

Comments

@Evgeny check out my update.
Pekka gravatar imagePekka ( 2010-05-02 02:43:24 -0500 )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 gravatar imagePekka ( 2010-05-02 13:01:28 -0500 )edit
@Pekka hey, you're right and I'm slow! Of course - why not be able to ask questions about html tags.
Evgeny gravatar imageEvgeny ( 2010-05-02 13:12:31 -0500 )edit
I'll take care of this soon.
Evgeny gravatar imageEvgeny ( 2010-05-02 13:13:13 -0500 )edit
@Evgeny we need those shiny red "status-xxx" badges from meta.stackoverflow.com! :)
Pekka gravatar imagePekka ( 2010-05-04 01:27:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2010-05-01 13:21:22 -0500

Seen: 1,032 times

Last updated: May 04 '10