1

I noticed I can't use sign < while posting.

It happened when I tried to write this text

Dictionary<string, int>

but in preview it was shown as

Dictionary

Obviously currently these are written as code (with 4 spaces)

But if you write it in plain text it does not show the part <string, int>.

What is the reason? is there any special syntax for < that hides the text?

Example right here. see inside edit!

4

1 Answer 1

6

Nothing special, just HTML.

Any HTML markup (in the whitelist) is gonna be rendered as the HTML:

Any HTML markup is <strong>gonna be rendered as the HTML</strong>

If it's not in the whitelist, like <string, int>, it's not gonna show it.

It has an open and a close tag, pretty much all it looks for, so you can't see this:

Unless you view the revision history.

You may ask, why not only treat it as HTML if it sees a close tag too? Well:

<br>

doesn't need a close tag.

5
  • well i wish it was only hidden when tag is understood by stackoverflow. currently <string, int> does not make sense in html. anyways thanks for the answer Commented Sep 7, 2015 at 18:50
  • @M.kazemAkhgary I think this is standard html...
    – Tim
    Commented Sep 7, 2015 at 20:32
  • 1
    @M.kazemAkhgary Markdown can pass the angle bracketed text through unaltered (depending on how it is configured). However, the browser will never show it. That is standard browser behavior. In fact, in some cases, the browser could choke on this (usually older versions) as it sees this an invalid HTML. If you want to include anything in angle brackets, you need to mark it as code (which it is): `Dictionary<string, int>` which will get rendered as <code>Dictionary&lt;string, int&gt;</code> and will display in any browser correctly.
    – Waylan
    Commented Sep 9, 2015 at 15:58
  • 2
    "Any HTML markup is gonna be rendered as the HTML" -- not exactly. The markdown parser sanitizes what it thinks is HTML (it's not too smart, just looks for angle brackets). If the markdown parser thinks it's HTML and it's not a whitelisted "tag", the parser removes the "tag".
    – hichris123
    Commented Sep 9, 2015 at 20:22
  • @hichris123 I've edited, feel free to improve upon it.
    – Tim
    Commented Sep 9, 2015 at 20:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .