summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2023-04-11 07:40:20 +0300
committerGitHub <noreply@github.com>2023-04-11 06:40:20 +0200
commit420b0c14eb0b82e05873191b277e889f95bc802b (patch)
treeb7b44efd06deeefc61c1825aa7712831e7027e74 /lib
parent4c073cffbe39ad85eb2efa2521c2ad3a97ba8268 (diff)
downloadNim-420b0c14eb0b82e05873191b277e889f95bc802b.tar.gz
Fix option lists with additional indentation in Markdown (#21633)
This is more Markdown-ish way to fix issue #21055, then PR #21625.
It does not enable RST definition lists, instead it makes
adding additional indentation (less than 4) right after a paragraph
be ignored, as it's done for all block elements in Markdown.
(In this case this tenet is applied to option lists that are not
part of CommonMark spec by themselves).
Diffstat (limited to 'lib')
-rw-r--r--lib/packages/docutils/rst.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim
index 6d05a2454..4bb623d20 100644
--- a/lib/packages/docutils/rst.nim
+++ b/lib/packages/docutils/rst.nim
@@ -2447,7 +2447,9 @@ proc parseParagraph(p: var RstParser, result: PRstNode) =
           result.addIfNotNil(parseLineBlock(p))
         of rnMarkdownBlockQuote:
           result.addIfNotNil(parseMarkdownBlockQuote(p))
-        else: break
+        else:
+          dec p.idx  # allow subsequent block to be parsed as another section
+          break
       else:
         break
     of tkPunct: