内联HTML被Jekyll逸出 [英] Inline HTML is escaped by Jekyll
问题描述
我在github页面中遇到了内联HTML的问题,其中内联HTML项目符号列表在表中进行了转义.下表的行:
I have a problem with inline HTML in a github page, where inline HTML bullet lists are escaped in tables. The rows of the following table:
| Name | Value |
|------|-----------------------|
| one | <i>foo</i> |
| two | <ul><li>bar</li></ul> |
表示为:
<tr>
<td>one</td>
<td><i>foo</i></td>
</tr>
<tr>
<td>two</td>
<td><ul><li>bar</li></ul></td>
</tr>
项目符号列表按GitHub UI的要求呈现,但是在gh-pages中,<ul>
被转义.为什么?
The bullet list is rendered as expected by the GitHub UI, but in gh-pages, the <ul>
is escaped. Why?
推荐答案
这是由 Kramdown 实现的a>,即在GitHub中渲染Markdown的Markdown处理器页面.
This is by design as implemented by Kramdown, which is the Markdown processor that renders Markdown in GitHub pages.
Kramdown将每一行都视为一行,并且不会在表单元格中呈现Markdown项目符号列表,并且代替呈现HTML,而是将其转义并输出为一行文本.
Kramdown treats each new line as a row and doesn't render Markdown bullet lists inside table cells, and instead of rendering HTML, it is escaped and outputted as a single line of text.
您可以使用 nomarkdown扩展<.只需将HTML代码包装为{::nomarkdown}
... {:/}
You can tell Kramdown to leave the HTML alone and output as is, with the nomarkdown extension. Just wrap the HTML code with {::nomarkdown}
... {:/}
例如
| Name | Value |
|------|-----------------------------------------|
| one | {::nomarkdown}<i>foo</i>{:/} |
| two | {::nomarkdown}<ul><li>bar</li></ul>{:/} |
这篇关于内联HTML被Jekyll逸出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!