Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In yaml block, first author cannot have a URL #9155

Closed
danshearer opened this issue Oct 23, 2023 · 2 comments
Closed

In yaml block, first author cannot have a URL #9155

danshearer opened this issue Oct 23, 2023 · 2 comments
Labels

Comments

@danshearer
Copy link

Explain the problem.

In the yaml header field "author", URLs work for any number of authors I tried, except for the first author.

author:  [Dan Shearer](https://cv.shearer.org/w/CV_List_View) and [Someone Else](https://example.org/)

which gives the error:

YAML parse exception at line 2, column 21,
while parsing a block mapping:
did not find expected key

Workaround

any text, even just a full stop followed by a space "." before the first author will prevent this happening. For example:

author: .  [Dan Shearer](https://cv.shearer.org/w/CV_List_View) and [Someone Else](https://example.org/)

Pandoc version

pandoc 3.1.8
Features: +server +lua
Scripting engine: Lua 5.4

Installed from amd64 binary download into VMs of Debian 12 and Ubuntu 23.04

@danshearer danshearer added the bug label Oct 23, 2023
@jgm
Copy link
Owner

jgm commented Oct 23, 2023

Generally when you run into a YAML parsing error, it means you should enclose the whole field in single quotes. That will ensure that things like colons are not interpreted by YAML, but rather by pandoc.

@danshearer
Copy link
Author

That fixes it, thanks. I didn't think of that.

How about that advice goes into relevant error messages, eg:

YAML parse exception at line 2, column 21,
while parsing a block mapping:
did not find expected key

Consider enclosing the entire field in 'single quotes'. 

@jgm jgm closed this as completed in 7115edf Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants