我如何在 asciidoc 中做删除线(line-through)?
How do I do strikethrough (line-through) in asciidoc?
如何在 adoc
文件中呈现删除线(或划线)?
假设我想写 "That technology is -c-r-a-p- not perfect."
That technology is [line-through]#crap# not perfect.
根据 Ascii Doc manual, [line-through]
is deprecated. You can test here.
It's important to understand that line-through is just a CSS role. Therefore, it needs support from the stylesheet in order to appear as though it is working.
If I run the following through Asciidoctor (or Asciidoctor.js):
[.line-through]#strike#
I get:
<span class="line-through">strike</span>
The default stylesheet has a rule for this:
.line-through{text-decoration:line-through}
You would need to do the same.
It is possible to customize the HTML that is generated using custom templates (Asciidoctor.js supports Jade templates). In that case, you'd override the template for inline_quoted, check for the line-through
role and produce either an <s>
or, preferably, a <del>
instead of the span.
That technology is +++<del>+++crap+++</del>+++ not perfect.
如果输出是针对 HTML 你可以传递 HTML.
The <s>
HTML element renders text with a strikethrough, or a line
through it. Use the element to represent things that are no longer
relevant or no longer accurate.
呈现为:
示例文本.
使用:
1.通过内联:
Example +++<s>text</s>+++.
2。透传宏:
Example pass:[<s>text</s>].
3。传递块:
++++
Example <s>text</s>.
++++
如何在 adoc
文件中呈现删除线(或划线)?
假设我想写 "That technology is -c-r-a-p- not perfect."
That technology is [line-through]#crap# not perfect.
根据 Ascii Doc manual, [line-through]
is deprecated. You can test here.
It's important to understand that line-through is just a CSS role. Therefore, it needs support from the stylesheet in order to appear as though it is working.
If I run the following through Asciidoctor (or Asciidoctor.js):
[.line-through]#strike#
I get:
<span class="line-through">strike</span>
The default stylesheet has a rule for this:
.line-through{text-decoration:line-through}
You would need to do the same.
It is possible to customize the HTML that is generated using custom templates (Asciidoctor.js supports Jade templates). In that case, you'd override the template for inline_quoted, check for the
line-through
role and produce either an<s>
or, preferably, a<del>
instead of the span.
That technology is +++<del>+++crap+++</del>+++ not perfect.
如果输出是针对 HTML 你可以传递 HTML.
The
<s>
HTML element renders text with a strikethrough, or a line through it. Use the element to represent things that are no longer relevant or no longer accurate.
呈现为:
示例文本.
使用:
1.通过内联:
Example +++<s>text</s>+++.
2。透传宏:
Example pass:[<s>text</s>].
3。传递块:
++++
Example <s>text</s>.
++++