diff --git a/DESCRIPTION b/DESCRIPTION index cf2d4c9100..7cd6030ac1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -86,7 +86,7 @@ Imports: highr, markdown, stringr (>= 0.6), - yaml (>= 2.1.5), + yaml (>= 2.1.14), methods, tools Suggests: diff --git a/R/params.R b/R/params.R index d44d81e976..a622c435f9 100644 --- a/R/params.R +++ b/R/params.R @@ -79,7 +79,6 @@ knit_params = function(text, evaluate = TRUE) { yaml = yaml_front_matter(text) if (is.null(yaml)) return(list()) - yaml = enc2utf8(yaml) knit_params_yaml(yaml, evaluate = evaluate) } @@ -106,7 +105,7 @@ knit_params_yaml = function(yaml, evaluate = TRUE) { # if we found paramters then resolve and return them if (is.list(parsed_yaml) && !is.null(parsed_yaml$params)) { - resolve_params(mark_utf8(parsed_yaml$params), evaluate = evaluate) + resolve_params(parsed_yaml$params, evaluate = evaluate) } else { list() } @@ -119,19 +118,6 @@ flatten_params = function(params) { res } -# copied from rmarkdown:::mark_utf8 -mark_utf8 = function(x) { - if (is.character(x)) { - Encoding(x) = 'UTF-8' - return(x) - } - if (!is.list(x)) return(x) - attrs = attributes(x) - res = lapply(x, mark_utf8) - attributes(res) = attrs - res -} - # Extract the yaml front matter (if any) from the passed lines. The front # matter is returned as a single-element character vector (with newlines # delimited by \n) suitable for passing to yaml::load. This code is based on