Citeproc: Require a digit for an implicit "page" locator...

inside explicit locator syntax `{...}`.

Previously a locator specified as `{}` would be rendered
as `p.` with nothing after it.

Closes #8288.
This commit is contained in:
John MacFarlane
2022-09-09 10:30:01 -07:00
parent 47dcb5720e
commit 35a3fb7e83
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -80,9 +80,9 @@ pLocatorDelimited locMap = try $ do
pLocatorLabelDelimited :: LocatorMap -> LocatorParser (Text, Text, Bool)
pLocatorLabelDelimited locMap
= pLocatorLabel' locMap lim <|> return ("", "page", True)
where
lim = stringify <$> anyToken
= pLocatorLabel' locMap (stringify <$> anyToken)
<|> (("", "page", True) <$ lookAhead (pMatchChar "digit" isDigit))
<|> (pure ("", "", True))
pLocatorIntegrated :: LocatorMap -> LocatorParser LocatorInfo
pLocatorIntegrated locMap = try $ do
@@ -100,7 +100,7 @@ Unbalanced curly } ends early[^18]
[^6]: Subsequent, p. {(a)}.
[^7]: Ibid-with-locator.
[^7]: Ibid.
[^8]: Ibid 123-35 numbers are suffix.