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() drops line breaks preceding leading/isolated --- #37

Closed
arnaudgallou opened this issue Nov 23, 2023 · 0 comments
Closed

$to_yaml() drops line breaks preceding leading/isolated --- #37

arnaudgallou opened this issue Nov 23, 2023 · 0 comments
Labels
bug Something isn't working PlumeQuarto PlumeQuarto related issue

Comments

@arnaudgallou
Copy link
Owner

tmp <- withr::local_tempfile(
  lines = "---\n---\nLorem ipsum\n---",
  fileext = ".qmd"
)

cat(readr::read_file(tmp))
#> ---
#> ---
#> Lorem ipsum
#> ---

aut <- PlumeQuarto$new(
  tibble::tibble(given_name = "Zip", family_name = "Zap"),
  tmp
)
aut$to_yaml()

cat(readr::read_file(tmp))
#> ---
#> author:
#>   - id: aut1
#>     name:
#>       given: Zip
#>       family: Zap
#> affiliations: {}
#> ---
#> Lorem ipsum---
@arnaudgallou arnaudgallou added bug Something isn't working PlumeQuarto PlumeQuarto related issue labels Nov 23, 2023
@arnaudgallou arnaudgallou changed the title $to_yaml() drops line breaks preceding --- that come after the top YAML header $to_yaml() drops line breaks preceding leading/isolated --- Nov 23, 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

No branches or pull requests

1 participant