Skip to content

Commit

Permalink
fix #605: allow non-alnum characters in .html filenames (#1231)
Browse files Browse the repository at this point in the history
also fix #902 and fix #1000
  • Loading branch information
yihui committed Aug 12, 2021
1 parent 68481c4 commit 1f2e422
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Expand Up @@ -52,6 +52,8 @@

## BUG FIXES

- Removed the requirement for `.html` filenames to be alphanumeric, which fixes a common error "Automatically generated filenames contain duplicated ones: -" (thanks, @psychelzh #605, @AzureRabbit #902, @carloslederman #1000, Ritsu Kitagawa https://stackoverflow.com/q/60014350/559676, Shrek Tan).

- Fix an issue with `bookdown_site()` where the comment in `site:` line key was not supported (thanks, @LDSamson, #1194).

- Figure reference links now point correctly to the top of figures (thanks, @GuillaumeBiessy, #1155).
Expand Down
2 changes: 1 addition & 1 deletion R/html.R
Expand Up @@ -395,7 +395,7 @@ split_chapters = function(
paste(c(num, id), collapse = '-')
} else id
if (is.null(nm)) stop('The heading ', x2, ' must have an id')
gsub('[^[:alnum:]]+', '-', nm)
nm
})
if (anyDuplicated(nms)) (if (isTRUE(opts$get('preview'))) warning else stop)(
'Automatically generated filenames contain duplicated ones: ',
Expand Down

0 comments on commit 1f2e422

Please sign in to comment.