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

whitespace is meaningful #5

Open
aronatkins opened this issue Mar 9, 2023 · 2 comments
Open

whitespace is meaningful #5

aronatkins opened this issue Mar 9, 2023 · 2 comments

Comments

@aronatkins
Copy link

This example document contains two "include" instances; the first instance includes the referenced file as expected. The second instance adds the {.yaml include = "stuff.yml"} text in the document.

---
title: includes
filters:
  - include-code-files
---

```{.yaml include="stuff.yml"}
```

```{.yaml include = "stuff.yml"}
```

I ended up with whitespace surrounding the equals sign because I was trying to adapt some of the knitr embed/verbatim examples; those use whitespace.

Renders as:

image

Using Quarto 1.2.335.

@cderv
Copy link
Contributor

cderv commented Mar 9, 2023

The syntax relies on Pandoc's syntax and no-space is required for the raw code block with class and attributes to be valid.

I don't think we can do much on the extension itself about that because the extension will do nothing - it is done in Lua and it would not get applied because AST would not contained a CodeBlock with include attribute which is what it checks.

Probably this would be improvment to do like YAML syntax linter in our editors to help find those spaces. Note that visual editor does not also see the second as a code block and would not format it as you would expect.

Do you have suggestion in mind on how to improve this ?

@aronatkins
Copy link
Author

I don't have a suggestion, no. Feel free to wontfix this if it's a restriction imposed by Pandoc.

As I mentioned, I had started with the knitr embed engine and, after encountering problems there, fell over to this option. I missed the fact that we went from meaningless-to-meaningful whitespace.

The story might change again once "include" works natively in Quarto, so again, no big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants