Ask Your Question
1

HTML Tags in titles getting eaten <fixed/>

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

Pekka gravatar image Pekka
550 22 28 37

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

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
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.

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

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

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

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

link publish delete flag offensive edit

Comments

@Evgeny check out my update. Pekka ( 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 ( 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 ( 2010-05-02 13:12:31 -0500 )edit
I'll take care of this soon. Evgeny ( 2010-05-02 13:13:13 -0500 )edit
@Evgeny we need those shiny red "status-xxx" badges from meta.stackoverflow.com! :) Pekka ( 2010-05-04 01:27:25 -0500 )edit

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]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

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

Seen: 930 times

Last updated: May 04 '10