asciidoc 中行首的文字星号到 html 的转换
Literal asterisk in the beginning of the line in asciidoc to html conversion
像 a * a
这样的 AsciiDoc 源被转换为 HTML 作为普通文本 "a * a"。如果星号是该行中的第一个非 space 字符,它会启动一个列表(这是正常的)。但是,我需要用文字星号开始一个段落。我尝试了以下方法来逃避它:
`*`
*
(在 <code>
内渲染)
\*
- \*(呈现为普通文本,但存在反斜杠)
+*+
*
(在 <code>
内渲染)
pass::[*]
- 错误:
block macro cannot occur here: pass::[*]
'*'
- *(在
<em>
内渲染 — 目前最接近我需要的)
如何在 AsciiDoc 源文件的行首指定一个星号,使其在 HTML 输出中显示为普通文本?
我知道你有两个选择。将其转换为列表的模式具体是星号后跟 space。
* item
将像这样呈现:
- 项目
您可以省略 space 或使用 space 属性。
*item
*{sp}item
将像这样呈现(分别):
*项目
* 项目
可以在此处找到有关属性和替换的更多信息:
http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions
结果是 inline passthroughs a different form of pass
is required. I also checked the solution suggested by 。我总结了以下选项:
- 直通:
pass:[*]
+++*+++
$$*$$
- 打扰列表模式
{empty}*
("official" 来自 FAQ 的解决方案)
*text
*{sp}
- HTML 转义
*
*
像 a * a
这样的 AsciiDoc 源被转换为 HTML 作为普通文本 "a * a"。如果星号是该行中的第一个非 space 字符,它会启动一个列表(这是正常的)。但是,我需要用文字星号开始一个段落。我尝试了以下方法来逃避它:
`*`
*
(在<code>
内渲染)
\*
- \*(呈现为普通文本,但存在反斜杠)
+*+
*
(在<code>
内渲染)
pass::[*]
- 错误:
block macro cannot occur here: pass::[*]
- 错误:
'*'
- *(在
<em>
内渲染 — 目前最接近我需要的)
- *(在
如何在 AsciiDoc 源文件的行首指定一个星号,使其在 HTML 输出中显示为普通文本?
我知道你有两个选择。将其转换为列表的模式具体是星号后跟 space。
* item
将像这样呈现:
- 项目
您可以省略 space 或使用 space 属性。
*item
*{sp}item
将像这样呈现(分别):
*项目
* 项目
可以在此处找到有关属性和替换的更多信息: http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions
结果是 inline passthroughs a different form of pass
is required. I also checked the solution suggested by
- 直通:
pass:[*]
+++*+++
$$*$$
- 打扰列表模式
{empty}*
("official" 来自 FAQ 的解决方案)*text
*{sp}
- HTML 转义
*
*