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

Linting: fenced divs need to be indented carefully, and so must executable code cells #11021

Open
Tracked by #8698
cscheid opened this issue Oct 9, 2024 · 1 comment
Assignees
Labels
lint linting-related issues
Milestone

Comments

@cscheid
Copy link
Collaborator

cscheid commented Oct 9, 2024

This is super obnoxious Markdown behavior:

Good

$ pandoc
* A list paragraph.
  stuff.

    ```r
    this works.
    ```
^D
<ul>
<li><p>A list paragraph. stuff.</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>this works.</span></code></pre></div></li>
</ul>

Not good

$ pandoc
* A list paragraph.
  stuff

    ::: {}

    ```r
    oh oh.
    ```

    :::
^D
<ul>
<li><p>A list paragraph. stuff</p>
<p>::: {}</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>oh oh.</span></code></pre></div>
<p>:::</p></li>
</ul>

This is particularly bad in Quarto, because executable code cells produce a fenced div around them:

Good

* A list paragraph
  stuff

    ```r
    cat("good")
    ```

Bad

* A list paragraph
  stuff

    ```{r}
    cat("good")
    ```

We should offer IDE syntax linting here.

@cscheid cscheid added the lint linting-related issues label Oct 9, 2024
@cscheid cscheid self-assigned this Oct 9, 2024
@cscheid cscheid added this to the Future milestone Oct 9, 2024
@cderv
Copy link
Collaborator

cderv commented Oct 9, 2024

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

No branches or pull requests

2 participants