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 15f54de5c4)
This commit is contained in:
Andreas Rumpf
2022-01-22 20:33:55 +01:00
committed by narimiran
parent 52d2ff601b
commit e1f3c74bdc

View File

@@ -927,7 +927,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])