Pagedown: data-icon attribute for section header not working in html_resume

Created on 13 Feb 2020  Â·  2Comments  Â·  Source: rstudio/pagedown

The section template Education {data-icon=graduation-cap data-concise=true} doesn't change the icon at all. Upon looking into the resulting html, it seems that the attributes (both data-icon and data-concise) are never respected at all.

Here is a minimum reproducible .Rmd:

````

title: "Test"
output:
pagedown::html_resume:
self_contained: true

knit: pagedown::chrome_print

Main

Test {#title}

Education {data-icon=graduation-cap data-concise=true}

````

In the resulting html (partial only):

<div id="main" class="section level1">
--
  | <h1>Main</h1>
  | <div id="title" class="section level2">
  | <h2>Test</h2>
  | </div>
  | <div id="education" class="section level2">
  | <h2>Education</h2>
  | </div>
  | </div>

The education div should have data-icon and data-concise attributes but it doesn't.
If we manually add the attribute back, the html will correctly change the default bookmark icon to the graduation-cap.

My system information:

R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.6.2  htmltools_0.4.0 tools_3.6.2     yaml_2.2.1      Rcpp_1.0.3      rmarkdown_2.1  
 [7] knitr_1.28      pagedown_0.8.1  xfun_0.12       digest_0.6.23   rlang_0.4.4     evaluate_0.14 

Additionally:

> rmarkdown:::pandoc_version()
[1] ‘2.8.0.1’

Most helpful comment

I've confirmed the issue can be fixed after I upgrade to Pandoc 2.9. Thx!

All 2 comments

Thanks a lot for the very detailed report!
It helped me a lot to identify this bug is similar to https://github.com/rstudio/rmarkdown/issues/1723 (this is a consequence of https://github.com/jgm/pandoc/issues/5965 introduced in Pandoc 2.8). You need to upgrade to Pandoc 2.9.

Please, note that rmarkdown does not support Pandoc 2.8.x, see the changelog for rmarkdown 2.1.

I've confirmed the issue can be fixed after I upgrade to Pandoc 2.9. Thx!

Was this page helpful?
0 / 5 - 0 ratings