jumpingrivers / namer

R package :package: for labelling chunks of RMarkdown files! :boom:
https://jumpingrivers.github.io/namer/
Other
94 stars 11 forks source link

Namer fails on commented chuncks #19

Closed csgillespie closed 5 years ago

csgillespie commented 5 years ago

If I have a chunk that is commented out, namer fails. For example, adding

<!-- ```{r, echo = FALSE} -->

gives

Error in parse(text = paste("alist(", quote_label(params), ")")) : 
  <text>:1:33: unexpected '->'
1: alist( '<!--, r', echo = FALSE -->

If the commented out chunk has no arguments,

<!-- ```{r} -->

namer is happy and works (namer version 0.1.3)


Seems related to https://github.com/lockedata/namer/issues/17

maelle commented 5 years ago

Ah too bad! A PR correcting what must be a wrong reprex would be very welcome :-)

csgillespie commented 5 years ago

@maelle Can you point me to the offending line? I did (briefly) look, ...

maelle commented 5 years ago

I'm not sure and can't look right now, sorry about that, but I imagine https://github.com/lockedata/namer/commit/323cdff15f5b533e81201785704e8771ebdd79e3 wasn't as good as I thought.

csgillespie commented 5 years ago

Also, the test suite https://github.com/lockedata/namer/blob/master/inst/examples/example5.Rmd#L30 seems to have a similar example.