如何在不渲染的情况下在降价文件中键入 html?
How do I type html in a markdown file without it rendering?
我想在降价文件中输入以下句子:she says <h1>
is large。我可以在 Whosebug 中使用 h1 周围的三个反引号完成此操作,但这不适用于 .md 文件。我还尝试了单反引号、单引号、双引号、主题标签、间距、<code>h1</code>
以及我能想到的所有其他方法。有办法吗?
您可以通过将 <
字符替换为 <
来转义它们,这是 <
的 HTML 转义序列。你的句子将是:
she says <h1> is large
作为旁注,original Markdown "spec" 有以下内容:
However, inside Markdown code spans and blocks, angle brackets and ampersands are always encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single < and & in your example code needs to be escaped.)
...这意味着,如果您在将标签放在反引号中时仍然得到标签,那么您使用的任何渲染器都不是 "compliant"(在某种程度上可以符合文档),您可能想要提交错误。
一般情况下,您可以将代码包围在单个反引号中以自动转义字符。否则只需使用 HTML 转义 < <
和 > >
.
即
she says <h1> is large or she says `<h1>` is large
反斜杠 (\
) 可用于转义 <
和 >
。
例如:她说
很大
P.S。单击 Edit
.
查看此答案的来源
我想在降价文件中输入以下句子:she says <h1>
is large。我可以在 Whosebug 中使用 h1 周围的三个反引号完成此操作,但这不适用于 .md 文件。我还尝试了单反引号、单引号、双引号、主题标签、间距、<code>h1</code>
以及我能想到的所有其他方法。有办法吗?
您可以通过将 <
字符替换为 <
来转义它们,这是 <
的 HTML 转义序列。你的句子将是:
she says <h1> is large
作为旁注,original Markdown "spec" 有以下内容:
However, inside Markdown code spans and blocks, angle brackets and ampersands are always encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single < and & in your example code needs to be escaped.)
...这意味着,如果您在将标签放在反引号中时仍然得到标签,那么您使用的任何渲染器都不是 "compliant"(在某种程度上可以符合文档),您可能想要提交错误。
一般情况下,您可以将代码包围在单个反引号中以自动转义字符。否则只需使用 HTML 转义 < <
和 > >
.
即
she says <h1> is large or she says `<h1>` is large
反斜杠 (\
) 可用于转义 <
和 >
。
例如:她说
很大
P.S。单击 Edit
.