Skip to content

Commit

Permalink
amend f67dd7f: fix the spurious warning about duplicated label report…
Browse files Browse the repository at this point in the history
…ed in #2387
  • Loading branch information
yihui committed Jan 8, 2025
1 parent c55fbd1 commit 842e438
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.49.3
Version: 1.49.4
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666", URL = "https://yihui.org")),
person("Abhraneel", "Sarma", role = "ctb"),
person("Adam", "Vogt", role = "ctb"),
person("Alastair", "Andrew", role = "ctb"),
Expand Down
2 changes: 1 addition & 1 deletion R/parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ parse_block = function(code, header, params.src, markdown_mode = out_format('mar
# for quarto, preserve the actual original params.src and do not remove the engine
if (!is_quarto() || opts_knit$get('tangle')) params.src = params
params = xfun::csv_options(params)
if (is.null(params$label)) params$label = unnamed_chunk()

# remove indent (and possibly markdown blockquote >) from code
if (nzchar(spaces <- get_chunk_indent(header))) {
Expand All @@ -115,6 +114,7 @@ parse_block = function(code, header, params.src, markdown_mode = out_format('mar
parts = partition_chunk(engine, code)
dup = intersect(names(params), names(parts$options))
params = merge_list(params, parts$options)
if (is.null(params$label)) params$label = unnamed_chunk()
label = params$label
if (length(dup)) warning(
"Duplicated chunk option(s) ", paste0("'", dup, "'", collapse = ', '),
Expand Down

0 comments on commit 842e438

Please sign in to comment.