diff --git a/DESCRIPTION b/DESCRIPTION index 27b751e8..a2594340 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bookdown Type: Package Title: Authoring Books and Technical Documents with R Markdown -Version: 0.43 +Version: 0.43.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 cc999d59..a702c347 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# CHANGES IN bookdown VERSION 0.44 + +- Figure numbering is now correctly working in HTML with Pandoc 3, when Markdown syntax is used to include images (thanks, @N0rbert, #1467). + + # CHANGES IN bookdown VERSION 0.43 - Support `split_by` for section level higher than `2` (i.e., `##` sections) in `gitbook` (thanks, @katrinabrock #1490, @lcougnaud #1346 #1347). diff --git a/R/html.R b/R/html.R index 31b5ea17..5739ca10 100644 --- a/R/html.R +++ b/R/html.R @@ -740,7 +740,7 @@ parse_fig_labels = function(content, global = FALSE) { m = gregexpr(sprintf('\\(#((%s):[-/[:alnum:]]+)\\)', reg_label_types), content) labs = regmatches(content, m) cntr = new_counters(label_types, chaps) # chapter counters - figs = grep('^
= "3") { + "//div[@class='figcaption']" + } else { + "//p[@class='caption']" + } + figure <- xml2::xml_find_first(content, xpath) + expect_match(xml2::xml_text(figure), "Figure 1.1", fixed = TRUE) + +})
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: