Skip to content

Fix LIST YAMLParseError bug#249

Open
ltctceplrm wants to merge 10 commits into
mProjectsCode:masterfrom
ltctceplrm:master
Open

Fix LIST YAMLParseError bug#249
ltctceplrm wants to merge 10 commits into
mProjectsCode:masterfrom
ltctceplrm:master

Conversation

@ltctceplrm

@ltctceplrm ltctceplrm commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

See issue #181

Note that the correct template in this case becomes actorsList: {{ LIST:actors }} without any quotes around the template!

@ltctceplrm

Copy link
Copy Markdown
Contributor Author

Seeing as #250 was posted recently I thought I might improve the PR a bit by adding a fix for this as well

This adds support for wikilinks in templates with an important note: The frontmatter does not accept wikilinks in comma separated values and would create invalid yaml so I split up ENUM and LIST into ENUM, ENUMYAML, LIST and LISTYAML. ENUMYAML ignores the requested wikiquotes and just outputs the comma separated values without any wikiquotes.

So you've got two options for the YAML:
actorsList: {{ LISTYAML:[[actors]] }}

actorsList: 
  - "[[Andy Lau]]"
  - "[[Tony Leung Chiu-wai]]"
  - "[[Anthony Chau-Sang Wong]]"

actorsEnum: {{ ENUMYAML:actors }}

actorsEnum: Andy Lau, Tony Leung Chiu-wai, Anthony Chau-Sang Wong

And two options for the body of the note:

{{ LIST:[[actors]] }}

  - [[Andy Lau]]
  - [[Tony Leung Chiu-wai]]
  - [[Anthony Chau-Sang Wong]]

{{ ENUM:[[actors]] }}

[[Andy Lau]], [[Tony Leung Chiu-wai]], [[Anthony Chau-Sang Wong]]

@mProjectsCode

Copy link
Copy Markdown
Owner

I have been thinking about this some more, and I am worried that this is the incorrect fix for the underlying problem. In my eyes, the template tags are not intended to be used in frontmatter; instead, people should use the property mappings.

@ltctceplrm

Copy link
Copy Markdown
Contributor Author

the template tags are not intended to be used in frontmatter

Aah in that case the easiest fix for the YAMLParseError would be just disallowing/ignoring LIST/ENUM in the YAML so it doesn't break note creation. Do you want me to update the PR or do I just close it so you can do the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants