Skip to content

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

Open
@cscheid

Description

@cscheid

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.

Metadata

Metadata

Assignees

Labels

lintlinting-related issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions