Skip to content

Commit

Permalink
fix #1454: the default TRE could destroy the characters in strip_html…
Browse files Browse the repository at this point in the history
…() so use PCRE instead
  • Loading branch information
yihui committed Feb 21, 2024
1 parent 54d9f91 commit 9a23818
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
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.37.1
Version: 0.37.2
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("Christophe", "Dervieux", , "[email protected]", role = c("ctb"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# CHANGES IN bookdown VERSION 0.38

- Fixed a bug that `gitbook()` may geneate an empty search index on certain platforms (thanks, @UlvHare, #1454).

# CHANGES IN bookdown VERSION 0.37

Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ clean_meta = function(meta_file, files) {

# remove HTML tags and remove extra spaces
strip_html = function(x) {
gsub('\\s{2,}', ' ', xfun::strip_html(x))
gsub('\\s{2,}', ' ', xfun::strip_html(x), perl = TRUE)
}

# remove the <script><script> content and references
Expand Down

3 comments on commit 9a23818

@yihui
Copy link
Member Author

@yihui yihui commented on 9a23818 Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cderv It seems there is a certain change in Pandoc devel version that causes our tests to fail: https://github.com/rstudio/bookdown/actions/runs/7990887575/job/21820726422 Do you have an idea?

@cderv
Copy link
Collaborator

@cderv cderv commented on 9a23818 Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh indeed, I see that in Pandoc release

It was added in 3.1.12 https://pandoc.org/releases.html#pandoc-3.1.12-2024-02-14

--number-sections now uses the first digit for the number of the top-level section, no matter what its level. So if the top-level section is level-2, numbers will be 1, 2, etc. rather than 0.1, 0.2, as in the past (#5071). For some backwards compatibility, we revert to the old behavior when the --number-offset option is used.

Test needs to be adapted at least, and code checks if this is a problem for bookdown

@cderv
Copy link
Collaborator

@cderv cderv commented on 9a23818 Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.