Skip to content

Commit

Permalink
Indent pandoc args correctly relative to the key
Browse files Browse the repository at this point in the history
From Pandoc 2.2.2, HsYAML is the new YAML parser and it has a stricter
interpretation of YAML 1.2. My previous indentation was causing an
error that resulted, I believe, in the pandoc_args being ignored (?).

I detected this via a test failure re: standard output. The parsing
error was showing up on standard output in a case where standard output
should have been empty.

https://stackoverflow.com/questions/31839686/wrapping-a-list-over-multiple-lines-yaml

jgm/pandoc#4959 (comment)
  • Loading branch information
jennybc committed Nov 3, 2018
1 parent e5aecab commit 6f7a055
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# reprex *development version*

* The YAML of reprex's template has been updated in light of the stricter YAML parser used in Pandoc >= 2.2.2.

* `rlang::set_attrs()` has been soft-deprecated and is no longer used internally.

# reprex 0.2.1
Expand Down
10 changes: 5 additions & 5 deletions R/whisker.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ yaml_md <- function(flavor = c("gfm", "md"),
" pandoc_args: [",
if (flavor == "gfm") {
c(
" '-f', 'markdown-implicit_figures',",
" '-t', 'commonmark',"
" '-f', 'markdown-implicit_figures',",
" '-t', 'commonmark',"
)
},
if (!is.null(pandoc_version)) {
if (pandoc_version < "1.16") {
" --no-wrap"
" --no-wrap"
} else {
" --wrap=preserve"
" --wrap=preserve"
}
},
" ]",
" ]",
"---"
)
## prepend with `#' ` in a separate step because
Expand Down

0 comments on commit 6f7a055

Please sign in to comment.