Skip to content
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

Plain Code Blocks in RMarkdown #252

Closed
russHyde opened this issue Jun 27, 2017 · 6 comments
Closed

Plain Code Blocks in RMarkdown #252

russHyde opened this issue Jun 27, 2017 · 6 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@russHyde
Copy link
Collaborator

russHyde commented Jun 27, 2017

I have an issue when running lintr (v1.0.0 in vim or within R) on Rmarkdown files that contain plain code blocks (as defined here). Running lintr on the following (temp.Rmd) throws an "Error: Malformed file!", despite plain code blocks being legal in Rmarkdown and lintr working fine on any other Rmarkdown files that contain R code. If the block containing "This isn't evaluated" is removed, lintr runs fine; when it's present, the Malformed file error comes up.

---
title: "Plain Code Bug?"
output: pdf_document
---
```{r}
42
```

```
This isn't evaluated
```

@sebastiansauer
Copy link

Similar for me; I get the same error. I have some non-R fenced blocks in my rmd-file, eg.,

some text

(This code blocks are taken from bookdown)

@russHyde
Copy link
Collaborator Author

russHyde commented May 3, 2018

Disregard this issue; I now wrap plain-code-blocks in a "~~~~" block and the Malformed file bug doesn't come up in lintr (I couldn't pinpoint the problem within lintr or it's dependencies though)

~~~~
This isn't evaluated
~~~~

@russHyde russHyde closed this as completed May 3, 2018
@randy3k
Copy link
Collaborator

randy3k commented Sep 14, 2018

I think we should keep this issue opened until it is probably addressed.

@randy3k randy3k reopened this Sep 14, 2018
@randy3k randy3k added the bug an unexpected problem or unintended behavior label Sep 14, 2018
@russHyde
Copy link
Collaborator Author

Do you think this relates to the #322 bug whereby lintr parses non-R code blocks (eg, embedded bash / python) as if they were R code?

@randy3k
Copy link
Collaborator

randy3k commented Sep 14, 2018

It is a different bug. At least a python block doesn't throw Malformed file.

@russHyde
Copy link
Collaborator Author

I've submitted a PR to hopefully fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants