diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-09-09 10:30:01 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-09-09 10:30:01 -0700 |
| commit | 35a3fb7e833c01f0352914a23727dff0145e7304 (patch) | |
| tree | 1023c3f51ccf035377582783a4b27fb2fa12e4fb /src/Text | |
| parent | 47dcb5720e6f3bb334df5fb58b0fbe32c062a4a4 (diff) | |
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.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Citeproc/Locator.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Citeproc/Locator.hs b/src/Text/Pandoc/Citeproc/Locator.hs index 35d5388b0..9e5daf0c5 100644 --- a/src/Text/Pandoc/Citeproc/Locator.hs +++ b/src/Text/Pandoc/Citeproc/Locator.hs @@ -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 |
