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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago
Pekka's avatar
590
Pekka
asked 14 years ago

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago, answered 14 years ago
link

Comments

@Evgeny check out my update.
Pekka's avatar Pekka (14 years ago)
@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 (14 years ago)
@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 (14 years ago)
I'll take care of this soon.
Evgeny's avatar Evgeny (14 years ago)
@Evgeny we need those shiny red "status-xxx" badges from meta.stackoverflow.com! :)
Pekka's avatar Pekka (14 years ago)
see more comments