diff --git a/R/purl.R b/R/purl.R index 30a3063bf..dfab0a46a 100644 --- a/R/purl.R +++ b/R/purl.R @@ -18,7 +18,7 @@ robust_purl <- function(path) { if (tolower(ext) == "rmd") { lines[!should_not_override] <- gsub( - "^```\\{.*\\}.*", "```{r purl = TRUE}", lines[!should_not_override] + "^```\\{ *[Rr] *.*\\}.*", "```{r purl = TRUE}", lines[!should_not_override] ) } else if (tolower(ext) == "rnw") { lines[!should_not_override] <- gsub( diff --git a/tests/testthat/in/parsable-R-success.Rmd b/tests/testthat/in/parsable-R-success.Rmd index 47ce464bb..71b227b53 100644 --- a/tests/testthat/in/parsable-R-success.Rmd +++ b/tests/testthat/in/parsable-R-success.Rmd @@ -15,3 +15,20 @@ parsable + code ```{r, purl=FALSE} fas / fk 12 - ``` + + +```{nonR chunk} +this is +``` + +```{f , x= 2} +this is +``` + +```{f, x= 2} +this is +``` + +```{ f, x= 2} +this is +```