summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2022-01-22 20:33:55 +0100
committerGitHub <noreply@github.com>2022-01-22 20:33:55 +0100
commit15f54de5c4ee2f70e1304201ebc8c8634b731c9a (patch)
tree1abed269064973e8345d7a52a257b0158568b7df
parent2bd1aa186e09565b2103394bd281478fa1b10ef1 (diff)
downloadNim-15f54de5c4ee2f70e1304201ebc8c8634b731c9a.tar.gz
RST: allow empty number-lines directives just like it was done for a decade; all my documents rely on this feature [backport (#19431)
-rw-r--r--lib/packages/docutils/rstgen.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim
index 9018087f7..d2180cb91 100644
--- a/lib/packages/docutils/rstgen.nim
+++ b/lib/packages/docutils/rstgen.nim
@@ -931,7 +931,8 @@ proc getField1Int(d: PDoc, n: PRstNode, fieldName: string): int =
   let nChars = parseInt(value, number)
   if nChars == 0:
     if value.len == 0:
-      err("field $1 requires an argument" % [fieldName])
+      # use a good default value:
+      result = 1
     else:
       err("field $1 requires an integer, but '$2' was given" %
           [fieldName, value])