Skip to content

Commit

Permalink
Merge pull request #93 from jennybc/forward-compat-glue-collapse
Browse files Browse the repository at this point in the history
If no yaml, avoid prepending with gratuitous `\n`
  • Loading branch information
zkamvar authored Mar 17, 2023
2 parents b2e0459 + 0601f19 commit c50a2f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/to_md.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ to_md <- function(yaml_xml_list, path = NULL, stylesheet_path = stylesheet()){
transform_to_md <- function(body, yaml, stylesheet) {
body <- xslt::xml_xslt(body, stylesheet = stylesheet)

yaml <- glue::glue_collapse(yaml, sep = "\n")
if (length(yaml) > 0) {
yaml <- glue::glue_collapse(yaml, sep = "\n")
}

c(yaml, body)
}
Expand Down

0 comments on commit c50a2f0

Please sign in to comment.