summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2020-12-29 05:32:11 +0300
committerGitHub <noreply@github.com>2020-12-29 03:32:11 +0100
commite70ac0f34c9f195f6e423b3ac7e54b912e62c71d (patch)
tree52db4b97a36fdebcebf17f47e9820a5d7c996bcc /tests
parent6d442a40a6f89572052d61aeb73ec26d1f3451ce (diff)
downloadNim-e70ac0f34c9f195f6e423b3ac7e54b912e62c71d.tar.gz
RST: fix directive with fields (#16490) (#16493)
* RST: fix directive with fields (#16490)

* Update tests/stdlib/trstgen.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/trstgen.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/stdlib/trstgen.nim b/tests/stdlib/trstgen.nim
index c3388ab7d..54a3db202 100644
--- a/tests/stdlib/trstgen.nim
+++ b/tests/stdlib/trstgen.nim
@@ -535,6 +535,17 @@ Test1
     doAssert count(output1, "<ul ") == 1
     doAssert count(output1, "</ul>") == 1
 
+  test "Nim (RST extension) code-block":
+    # check that presence of fields doesn't consume the following text as
+    # its code (which is a literal block)
+    let input0 = dedent """
+      .. code-block:: nim
+         :number-lines: 0
+
+      Paragraph1"""
+    let output0 = rstToHtml(input0, {roSupportMarkdown}, defaultConfig())
+    doAssert "<p>Paragraph1</p>" in output0
+
   test "RST admonitions":
     # check that all admonitions are implemented
     let input0 = dedent """