quarto-dev / quarto-cli

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

[Docusaurus] code block with filename placed at the top of the tab item does not work #5190

Closed eitsupi closed 1 year ago

eitsupi commented 1 year ago

Bug description

Similar to #5103

This qmd file in Docusaurus project

---
title: foo
---

:::{.panel-tabset}

## Not work

```{.python filename="Python"}
print("bar")

Work

print("bar")

:::


will be converted to this md file

````md
---
title: foo
---

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

<Tabs>
<TabItem value="Not work">
```python title="Python"
print("bar")

``` python print("bar") ```


and rendered like this.

![image](https://user-images.githubusercontent.com/50911393/232023044-c8f94a9b-a1b1-49e1-9900-cb59beb17a55.png)

I tested it with the edge dev version of Quarto CLI.

```sh
$ 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

Sorry about the continued docusaurus issues - it wants a particular whitespace setup that we need to work around in a number of different places. (another) PR incoming.

eitsupi commented 1 year ago

Thanks for fixing it so quickly.

I feel that the Docusaurus integration is really great. Happy to contribute in any way to improving this.