Skip to content

Commit

Permalink
set rmarkdown.html_dependency.header_attr in common config for book…
Browse files Browse the repository at this point in the history
… formats

in order to deactivate double handling of header attributes

Closes #865. Requires rmarkdown 2.12
  • Loading branch information
cderv committed Feb 4, 2022
1 parent 881de1e commit 7f92ffa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bookdown
Type: Package
Title: Authoring Books and Technical Documents with R Markdown
Version: 0.24.8
Version: 0.24.9
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("JJ", "Allaire", role = "ctb"),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

- Fix an issue with `html_book()` and `toc.css` not working correctly with recent pandoc (thanks, @florisvdh, #1268).

- Fix an issue with unneeded `header-attr.js` inserted by **rmarkdown** while **bookdown** already cleans attributes (thanks, @salim-b, #865).

# CHANGES IN bookdown VERSION 0.24

## MAJOR CHANGES
Expand Down
6 changes: 6 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ common_format_config = function(
# when the output is LaTeX, force LaTeX tables instead of default Pandoc tables
# http://tex.stackexchange.com/q/276699/9128
config$knitr$opts_knit$kable.force.latex = TRUE

# deactivate header attributes handling from rmarkdown
# as done in bookdown::clean_html_tag()
opts <- options(rmarkdown.html_dependency.header_attr = FALSE)
config$on_exit <- function() options(opts)

config
}

Expand Down

0 comments on commit 7f92ffa

Please sign in to comment.