提升等级后如何恢复到之前的编号和缩进?

How to get back to previous numbering value and indentation after promoting a level?

这个:

. Level one.
.. Level two.
   How do I get back to level 1?
. Back to level one.

将导致:

1. Level one.
   a. Level two. How do I get back to level 1?
2. Back to level one.

但是我怎样才能做到这一点:

1. Level one.
   a. Level two.
   How do I get back to level 1?
2. Back to level one.

所以“How do I get back to level 1?”的缩进和Level one.一样?

asciidoctor 的一个好处是文本布局方面的限制。最好的解决方案是按原样接受布局,因为它从语义上正确呈现。我想您有充分的理由以不同的方式来做,也许以下解决方案会有所帮助:

. Level one.
.. Level two.

How do I get back to level 1?

[start=2]
. Back to level one.

此解决方案的缺点是,"How to I get back to level1" 被格式化为普通文本。 Asciidoctor Documentation 包含一些示例。

试试这个:

. Level one.
.. Level two.
+
How do I get back to level 1?
. Back to level one.

http://asciidoctor.org/docs/user-manual/#list-continuation

以下应该有效:

. Level one.                                                                                   
.. Level two.                                                                                  

+                                                                                              
How do I get back to level 1?                                                                  

. Back to level one.          

注意空白行和单独的 +:它们将列表级别后移一级,同时将下一段附加到上一项。

the AsciiDoc writer's guide on asciidoctor.org, about attaching to an ancestor list:

You may find that you need to attach block content to a parent list item instead of the current one. In other words, you want to attach the block content to the parent list item so it becomes a sibling of the child list. To do this, you add a blank line before the list continuation. The blank line signals to the list continuation to move out of the current list so it attaches the block to the last item of the parent list.

...

Each blank line that precedes the list continuation signals a move up one level of nesting.

以上在我的浏览器中呈现为

1. Level one.

   a. Level two.

  How do I get back to level 1?

2. Back to level one.

并在 HTML 中作为

<div class="olist arabic">
<ol class="arabic">
<li>
<p>Level one.</p>
<div class="olist loweralpha">
<ol class="loweralpha" type="a">
<li>
<p>Level two.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>How do I get back to level 1?</p>
</div>
</li>
<li>
<p>Back to level one.</p>
</li>
</ol>
</div>