diff --git a/DESCRIPTION b/DESCRIPTION index 25c3cb15c..658e0827a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bookdown Type: Package Title: Authoring Books and Technical Documents with R Markdown -Version: 0.39.1 +Version: 0.39.2 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("Christophe", "Dervieux", , "cderv@posit.co", role = c("ctb"), diff --git a/NEWS.md b/NEWS.md index cd3a4fc28..32690cd46 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # CHANGES IN bookdown VERSION 0.40 +- Footnotes are not rendered correctly when `katex` is used to render LaTeX math expressions (thanks, @pbreheny, #1470). # CHANGES IN bookdown VERSION 0.39 diff --git a/R/html.R b/R/html.R index 3de2b9c2a..e322ef3f3 100644 --- a/R/html.R +++ b/R/html.R @@ -1030,7 +1030,7 @@ parse_footnotes = function(x) { j = which(x == '') j = min(j[j > i]) n = length(x) - r = '
  • (?s).+?]*?>\\X

  • ' + r = '
  • (?s).+?]*?>[^<]+

  • ' s = paste(x[i:n], collapse = '\n') items = unlist(regmatches(s, gregexpr(r, s, perl = TRUE))) list(items = setNames(items, gsub(r, 'fn\\1', items, perl = TRUE)), range = i:j)