Skip to content

Pandoc versions 2.13+ include the yaml header in the output for GFM #375

Description

@jimhester

With pandoc 2.12 this works as expected.

tmp <- fs::dir_create(fs::file_temp())
reprex::reprex(input = "rmarkdown::pandoc_version()\n", venue = "gh", wd = tmp, advertise = FALSE)
readLines(fs::dir_ls(tmp, glob = "*md"))
#> [1] "``` r"                       "rmarkdown::pandoc_version()"
#> [3] "#> [1] '2.12'"               "```"

With pandoc 2.13 we get the YAML header as well

tmp <- fs::dir_create(fs::file_temp())
reprex::reprex(input = "rmarkdown::pandoc_version()\n", venue = "gh", wd = tmp, advertise = FALSE)
readLines(fs::dir_ls(tmp, glob = "*md"))
#>  [1] "---"                          "author: jhester"             
#>  [3] "date: 2021-04-28"             "output:"                     
#>  [5] "  reprex::reprex_document:"   "    advertise: false"        
#>  [7] "title: legal-mink\\_reprex.R" "---"                         
#>  [9] ""                             "``` r"                       
#> [11] "rmarkdown::pandoc_version()"  "#> [1] '2.13'"               
#> [13] "```"

Created on 2021-04-28 by the reprex package (v2.0.0)

It looks like this is fallout from jgm/pandoc#6537, pandoc now parses the YAML header for GFM, before it was silently discarded.

I think likely reprex will have to either remove the header from the input file it sends to pandoc, or remove it from the output after the fact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions