quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.95k stars 325 forks source link

[Docusaurus] Callout block placed at the top of the tab item does not work #5103

Closed eitsupi closed 1 year ago

eitsupi commented 1 year ago

Bug description

When the following qmd file is rendered in the Docusaurus project, the first callout block is not rendered correctly.

---
title: foo
---

## test

::::{.panel-tabset}

### Not work

:::{.callout-important}

This is important

:::

foo

### Work

bar

:::{.callout-important}

This is important

:::

::::

It seems that a blank line is required between <TabItem value="Not work"> and :::important.

---
title: foo
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## test {#test}

<Tabs>
<TabItem value="Not work">
:::important

This is important

:::

foo

</TabItem>
<TabItem value="Work">

bar

:::important

This is important

:::
</TabItem>
</Tabs>

image

I tested it with 1.2 and the edge unreleased version on Debian Linux.

$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      Path: /tmp/quarto-cli/package/dist/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.2
      Path: /usr/bin/python3
      Jupyter: 5.3.0
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

Checklist

cscheid commented 1 year ago

@eitsupi thanks for the report as always. I was having a hard time reproducing your bug, but mostly because there was a different bug. JJ and I did fix the spacing issue you saw, but locally I'm seeing a larger problem, which is that a tabset inside a callout wouldn't get rendered at all.

On main, I see this as the .md output for your file:

---
title: foo
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## test {#test}

<Tabs>
<TabItem value="Not work">

foo

</TabItem>
<TabItem value="Work">

bar

</TabItem>
</Tabs>

After my fix, I see this:

---
title: foo
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## test {#test}

<Tabs>
<TabItem value="Not work">

:::important

This is important

:::

foo

</TabItem>
<TabItem value="Work">

bar

:::important

This is important

:::

</TabItem>
</Tabs>

(Note the correct spacing, though!) Thanks for the continued patience on this. v1.3 has a large structural change in our filters, and custom formats took a bigger hit than we had envisioned.

eitsupi commented 1 year ago

Thank you for working on fixing this immediately!

I was having a hard time reproducing your bug, but mostly because there was a different bug. JJ and I did fix the spacing issue you saw, but locally I'm seeing a larger problem, which is that a tabset inside a callout wouldn't get rendered at all.

Sorry for not reporting that. I didn't report it because it seemed to have been fixed while going back and forth between the 1.2 and dev versions on my local, but on second thought I think I may have just been looking at a 1.2 converted md file... So, this bug is in 1.2, and as you discovered, there was a bigger bug in 1.3...

cscheid commented 1 year ago

This should be fixed now on main, from https://github.com/quarto-dev/quarto-cli/commit/35fd0b30b90b6c0327c11a91120934a353a5e27f

eitsupi commented 1 year ago

Works fine, thanks!