RST: allow empty number-lines directives just like it was done for a decade; all my documents rely on this feature [backport (#19431)

This commit is contained in:
Andreas Rumpf 2022-01-22 20:33:55 +01:00 • committed by GitHub
commit 15f54de5c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -931,7 +931,8 @@ proc getField1Int(d: PDoc, n: PRstNode, fieldName: string): int =
let nChars = parseInt(value, number) let nChars = parseInt(value, number)
if nChars == 0: if nChars == 0:
if value.len == 0: if value.len == 0:
err("field $1 requires an argument" % [fieldName]) # use a good default value:
result = 1
else: else:
err("field $1 requires an integer, but '$2' was given" % err("field $1 requires an integer, but '$2' was given" %
[fieldName, value]) [fieldName, value])