This is not a bug. The Stack Overflow post editor supports a limited set of HTML tags, including:
<strong>
<em>
<strike>
<code>
<blockquote>
<br>
<a>
- and more… (this is not a comprehensive list, just an example; see here for the full list)
Nearly all of these can also be achieved using the appropriate Markdown syntax (with <strike>
being the only exception), but we still support the HTML tags.
That means things like std::vector<char> get displayed as std::vector because it interprets <char> as being the HTML tag <char>
. Which isn't an HTML tag, and even if it were, not one that the sanitizer supports.
This is, of course, why we have inline code formatting, so that you can type things like std::vector<char>
. Any time you want to type code, you should use inline code formatting. It not only ensures that characters aren't misinterpreted and swallowed by the post formatting engine, but it also serves a semantic and visual function of designating it as code.
However, please do not abuse the inline formatting feature to "highlight" things that are not code!
If you absolutely insist on typing things like std::vector<char>
without using inline code formatting, then you can escape the angle brackets using <
and >
. (This is what I did above to get std::vector<char> to display.) All of the escape sequences that I've occasioned to tried so far have worked, including —, →, ←, …, ±, ∞, ©, etc.
std::vector<char>
as inline code using the backticks. – πάντα ῥεῖ Aug 23 '14 at 11:25