ShawHahnLab / chiimp

Computational, High-throughput Individual Identification through Microsatellite Profiling
GNU Affero General Public License v3.0
2 stars 3 forks source link

Report rendered with pandoc>=2.6 has quotes around title, author, and date #68

Closed ressy closed 2 years ago

ressy commented 2 years ago

Something in the YAML parsing has changed between pandoc 2.5 and 2.6 so that the --metadata=key:val arguments we give keep internal quotes rather than parsing them as encapsulating strings.

In render_report:

rmarkdown::render(fp_report_in, quiet = TRUE, output_file = fp_report_out,
                      output_options = list(pandoc_args = pandoc_args))

If pandoc_args contains --metadata=title:"report title", the quotes would be parsed out in pandoc < 2.6 but kept in pandoc>=2.6.

I'm not sure the quotes were ever actually necessary (they'd be optional in YAML anyway, and these pandoc arguments are already handled as a vector so word-splitting shouldn't be an issue).

ressy commented 2 years ago

Possibly related: https://github.com/jgm/pandoc/issues/5177

ressy commented 2 years ago

On second thought... whether or not the quotes would be optional according to YAML would depend on the string value, which was probably my thinking when I put the quotes there in the first place. The latest pandoc code is more accommodating than YAML itself would be, though, and recognizes boolean values first and everything else as-is as a string (quotes included).

...but wait, the previous pandoc behavior casts all-but-bool to string anyway, so no, the quotes were probably never needed, practically speaking. Removing them should then produce the same behavior here no matter the pandoc version.

ressy commented 2 years ago

There, in e471ed6 both report.html CircleCI artifacts under newer and older pandoc don't have extra quotes on those fields. That should do it.