Skip to content

Commit

Permalink
Allow space between name and = for attributes src / href when searchi…
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv committed Sep 25, 2023
1 parent 661567e commit 3898705
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGES IN bookdown VERSION 0.36

- Fix an issue with parsing resources from raw HTML code (thanks, @lennylin, https://community.rstudio.com/t/bookdown-image-with-a-weblink/172542)


# CHANGES IN bookdown VERSION 0.35

Expand Down
2 changes: 1 addition & 1 deletion R/html.R
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ move_files_html = function(output, lib_dir) {
if (is.null(o <- opts$get('output_dir'))) return()
x = read_utf8(output)
# detect local resources used in HTML
r = '[- ](src|href)="([^"]+)"'
r = '[- ](src|href)\\s*=\\s*"([^"]+)"'
m = gregexpr(r, x)
f = unlist(lapply(regmatches(x, m), function(z) {
if (length(z) == 0) z else gsub(r, '\\2', z)
Expand Down

0 comments on commit 3898705

Please sign in to comment.