Literal block highlighting extends too far when the block is contained within a bullet, e.g.:
- A bullet with literal following::
Correctly highlighted literal
Incorrectly highlighted as literal
Correctly unhighlighted.
As I understand it from https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#bullet-lists, the indentation level for the body of the bullet is determined by the first non-whitespace character after the bullet character (starting at A bullet with above). The subsequent literal block must be indented relative to that, and that literal block should end when the additional indentation is removed (at the line Incorrectly highlighted as literal).
Using the latest vim-restructuredtext, the line Incorrectly highlighted as literal is highlighted as a literal block.
Using the rst2html command from docutils <https://docutils.sourceforge.io/>, the above reStructuredText renders correctly as:
<ul>
<li><p class="first">A bullet with literal following:</p>
<pre class="literal-block">
Correctly highlighted literal
</pre>
<p>Incorrectly highlighted as literal</p>
</li>
</ul>
<p>Correctly unhighlighted.</p>
</div>
Literal block highlighting worked correctly for such cases before 796536c.
Literal block highlighting extends too far when the block is contained within a bullet, e.g.:
As I understand it from https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#bullet-lists, the indentation level for the body of the bullet is determined by the first non-whitespace character after the bullet character (starting at
A bullet withabove). The subsequent literal block must be indented relative to that, and that literal block should end when the additional indentation is removed (at the lineIncorrectly highlighted as literal).Using the latest vim-restructuredtext, the line
Incorrectly highlighted as literalis highlighted as a literal block.Using the
rst2htmlcommand fromdocutils <https://docutils.sourceforge.io/>, the above reStructuredText renders correctly as:Literal block highlighting worked correctly for such cases before 796536c.