-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with markdown code chunk with language name #472
Comments
I modified some code related to this a year or so ago. It might be worth having a look in https://github.com/jimhester/lintr/blob/master/R/extract.R - specifically at the regular expression in |
Thanks for reporting this. I just tried fixing this and ended up on a wild-goose chase. It did seem like a strange bug, because lintr identifies R code blocks using knitr's regexes for identifying R code blocks. If we make a slight change to your
... and then knit that, the second code chunk does not get passed to the R engine by knitr: Although the contents of the model object In short, lintr is telling you that the file is malformed, because, according to knitr's rules for identifying R-code blocks, it is malformed: the Closing |
Thanks for investigating in this. Then it would mean that the Rmd cannot be processed if it includes any text code chunk with specified language that is not intended for running but code demonstration? For example, the following Rmd should be perfectly valid for
|
Sorry, I mustn't have understood the original issue. Does the Looked into this a bit further, so |
…uage in Rmd lintr was complaining that files were malformed when containing unevaluated code-blocks of the following form (cpp is a format specifier for use by markdown). ~~~~ ```cpp blah ``` ~~~~ "```" matches the end-block pattern for Rmd-code blocks; the change allows the start pattern for unevaluated blocks to be "```" or "```some_language" A couple of such blocks were added to the .Rmd used in the knitr-format test. `extract_r_source` has been refactored: selection of start / end positions for each code block is handled by `get_chunk_positions`.
lintr does not seem to work with Rmd file with markdown code chunk with language name specified. Following are examples that show the problem.
The text was updated successfully, but these errors were encountered: