Skip to content

Commit 285cba4

Browse files
authored
fix #909: disable pandoc --file-scope by default (#916)
The `--file-scope` behavior introduced in bookdown v0.20 is now disabled by default. This is due to broken TOC links for duplicate section names (e.g. "Exercises") that have automatically generated identifiers.
1 parent aa6bd19 commit 285cba4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# CHANGES IN bookdown VERSION 0.21
22

3+
## MINOR CHANGES
34

5+
- The `--file-scope` behavior introduced in bookdown v0.20 is now disabled by default. This is due to broken TOC links for duplicate section names (e.g., "Exercises"; see #909) that have automatically generated identifiers.
46

57
# CHANGES IN bookdown VERSION 0.20
68

R/utils.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ new_counters = function(type, rownames) {
2626

2727
# set common format config
2828
common_format_config = function(
29-
config, format, file_scope = getOption('bookdown.render.file_scope', TRUE)
29+
config, format, file_scope = getOption('bookdown.render.file_scope', FALSE)
3030
) {
3131

32-
# provide file_scope unless disabled via the global option
32+
# provide file_scope if requested
3333
if (file_scope) config$file_scope = md_chapter_splitter
3434

3535
# set output format

0 commit comments

Comments
 (0)