Skip to content

Commit 842e438

Browse files
committed
amend f67dd7f: fix the spurious warning about duplicated label reported in #2387
1 parent c55fbd1 commit 842e438

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: knitr
22
Type: Package
33
Title: A General-Purpose Package for Dynamic Report Generation in R
4-
Version: 1.49.3
4+
Version: 1.49.4
55
Authors@R: c(
6-
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
6+
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666", URL = "https://yihui.org")),
77
person("Abhraneel", "Sarma", role = "ctb"),
88
person("Adam", "Vogt", role = "ctb"),
99
person("Alastair", "Andrew", role = "ctb"),

R/parser.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ parse_block = function(code, header, params.src, markdown_mode = out_format('mar
9999
# for quarto, preserve the actual original params.src and do not remove the engine
100100
if (!is_quarto() || opts_knit$get('tangle')) params.src = params
101101
params = xfun::csv_options(params)
102-
if (is.null(params$label)) params$label = unnamed_chunk()
103102

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

0 commit comments

Comments
 (0)