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

$to_yaml() can slightly modify YAML data not related to authors #56

Closed
arnaudgallou opened this issue Dec 21, 2023 · 0 comments · Fixed by #61
Closed

$to_yaml() can slightly modify YAML data not related to authors #56

arnaudgallou opened this issue Dec 21, 2023 · 0 comments · Fixed by #61
Labels
bug Something isn't working PlumeQuarto PlumeQuarto related issue

Comments

@arnaudgallou
Copy link
Owner

arnaudgallou commented Dec 21, 2023

Rewriting YAML headers slightly alter some data unrelated to authors:

lines <- "
  foo: !!float 123
  # a comment that will be dropped
  bar: >
    Lorem ipsum
    Vivamus quis
  baz: &id1
    a: 1
    b: 2
  boz: *id1
"

yaml::yaml.load(lines) |> 
  yaml::as.yaml() |> 
  cat()
#> foo: 123.0
#> bar: |
#>   Lorem ipsum Vivamus quis
#> baz:
#>   a: 1
#>   b: 2
#> boz:
#>   a: 1
#>   b: 2

This might not be desirable… I could detect these cases, write author data in an empty YAML header at the beginning of the document if they exist, and notify the user about it.

@arnaudgallou arnaudgallou added bug Something isn't working feature New feature or request PlumeQuarto PlumeQuarto related issue and removed feature New feature or request labels Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PlumeQuarto PlumeQuarto related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant