summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/docgen.nim2
-rw-r--r--lib/packages/docutils/rstgen.nim9
2 files changed, 7 insertions, 4 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 67ff9edf1..74fb305ac 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -816,7 +816,7 @@ proc commandRstAux(filename, outExt: string) =
       # Nim's convention: every path is relative to the file it was written in:
       outp = splitFile(d.filename).dir / filename
     writeFile(outp, content)
-    let cmd = unescape(cmd) % quoteShell(outp)
+    let cmd = cmd % quoteShell(outp)
     rawMessage(hintExecuting, cmd)
     if execShellCmd(cmd) != status:
       rawMessage(errExecutionOfProgramFailed, cmd)
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim
index e6c95b59e..ee1f0076c 100644
--- a/lib/packages/docutils/rstgen.nim
+++ b/lib/packages/docutils/rstgen.nim
@@ -820,7 +820,7 @@ proc parseCodeBlockField(d: PDoc, n: PRstNode, params: var CodeBlockParams) =
   ##
   ## This supports the special ``default-language`` internal string generated
   ## by the ``rst`` module to communicate a specific default language.
-  case n.getArgument.toLower
+  case n.getArgument.toLowerAscii
   of "number-lines":
     params.numberLines = true
     # See if the field has a parameter specifying a different line than 1.
@@ -836,8 +836,11 @@ proc parseCodeBlockField(d: PDoc, n: PRstNode, params: var CodeBlockParams) =
     params.filename = n.getFieldValue.strip
   of "test":
     params.testCmd = n.getFieldValue.strip
-    if params.testCmd.len == 0: params.testCmd = "nim c -r $1"
-  of "status":
+    if params.testCmd.len == 0:
+      params.testCmd = "nim c -r $1"
+    else:
+      params.testCmd = unescape(params.testCmd)
+  of "status", "exitcode":
     var status: int
     if parseInt(n.getFieldValue, status) > 0:
       params.status = status