< has special meaning in markdown?

岁酱吖の 提交于 2019-12-02 06:23:45

As the rules state:

For any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags.

Therefore, Markdown passes < and > through unaltered. However, as those characters are HTML tag deliminators, your browser will interpret anything between a < and a > as an HTML tag and it will not display it. Of course, if you never open a tag (with <), then a closing tag (>) will be ignored by the browser. Therefore, when using a < as a plain text character, it is best to use the HTML entity to ensure the browser sees it as such: &lt; (hint: Less Than => &lt; => <)

So, to use your example input:

Choices for blank 91:       __A__:  pa>pb      __B__:  pa&lt;pb      __C__: pa==pb      __D__: pa&lt;>pb

Choices for blank 92:       __A__:  pa&lt;>pb      __B__:  pa&lt;pb      __C__:  pa>pb      __D__: pa==pb

The output would look like this:

Choices for blank 91: A: pa>pb B: pa<pb C: pa==pb D: pa<>pb

Choices for blank 92: A: pa<>pb B: pa<pb C: pa>pb D: pa==pb

Note that this is the behavior of your browser. There is nothing Markdown could do to change that unless it did not allow/support using raw HTML within Markdown documents.

Of course, typing &lt; each time you want a < character is less than ideal. Generally, text which contains such characters could be classified as "code". Therefore it is usually best to just wrap it in a code span (when it is embedded in text) or a code block (when all the code consists of a block of one or more lines).

For example, this paragraph contains `<>` characters.

The above Markdown will result in the following HTML being generated:

<p>For example, this paragraph contains <code>&lt;&gt;</code> characters.</p>

Notice that the angle brackets were converted to &lt;&gt; for you (and wrapped in <code> tags). And the browser will render that as:

For example, this paragraph contains <> characters.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!