Skip to content

Commit e1f3c74

Browse files
Araqnarimiran
authored andcommitted
RST: allow empty number-lines directives just like it was done for a decade; all my documents rely on this feature [backport (#19431)
(cherry picked from commit 15f54de)
1 parent 52d2ff6 commit e1f3c74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/packages/docutils/rstgen.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,8 @@ proc getField1Int(d: PDoc, n: PRstNode, fieldName: string): int =
927927
let nChars = parseInt(value, number)
928928
if nChars == 0:
929929
if value.len == 0:
930-
err("field $1 requires an argument" % [fieldName])
930+
# use a good default value:
931+
result = 1
931932
else:
932933
err("field $1 requires an integer, but '$2' was given" %
933934
[fieldName, value])

0 commit comments

Comments
 (0)