quarto-dev / quarto-cli

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

Shortcodes don't work well inside grid tables #8732

Open wibeasley opened 7 months ago

wibeasley commented 7 months ago

Bug description

I believe Quarto (or maybe Pandoc) is getting confused by the Grid-style of specifying a table. Maybe because the table header uses a =============== line.

I'm using the Grid style because the authors want multiple bullets in a table cell.

Steps to reproduce

This is comes from a chapter in a Quarto book.

The relevant section starts at line 497. Here's a quick screenshot of the first few lines of the table image

Expected behavior

The table is rendered as expected, when built on local machine w/ Quarto 1.3.450.

image

Actual behavior

However problems appear when built on local machine w/ Quarto 1.4.549 (and more relevantly, when built with GitHub Actions and hosted on GitHub Pages.

image

Your environment

IDEs: RStudio 2023.06.1 build 524. I've also tried VS Code.

This is occurring on a Windows desktop and GitHub Actions Ubuntu image.

Quarto check output

quarto check
Quarto 1.4.549
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.549
      Path: C:\Users\wibea\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\wibea\AppData\Roaming\TinyTeX\bin\win32\
      Version: 2022

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

[>] Checking Python 3 installation....OK
      Version: 3.11.2
      Path: C:/Program Files/Python311/python.exe
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with py -m pip install jupyter

[>] Checking R installation...........OK
      Version: 4.3.2
      Path: C:/PROGRA~1/R/R-43~1.2PA
      LibPaths:
        - D:/projects/r-libraries
        - C:/Users/wibea/AppData/Local/R/win-library/4.3
        - C:/Program Files/R/R-4.3.2patched/library
      knitr: 1.45
      rmarkdown: 2.25

[>] Checking Knitr engine render......OK
cscheid commented 7 months ago

I am pretty sure the issue here is the presence of a shortcode inside a grid table.

That should work, but we had to change the way we handle shortcodes and a side effect is that it can change the width of the line being rendered to. That is very likely causing the Grid table reader to not understand the table correctly.

Unfortunately, I can't think of a simple fix for this situation right now, and the change in shortcode behavior is not something we can disable cleanly.

wibeasley commented 7 months ago

Thanks for the fast response, @cscheid. You're right --removing those icons fixed the headers.

The vertical alignment within the cells switch from top-aligned to center-aligned. But it's not a problem for my scenario. Close the issue if you'd like.

image

cscheid commented 7 months ago

@wibeasley Let's keep this open - it's a real bug in Quarto 1.4. I think I have a fix for it but it's tricky and it'll take me a bit of time to do it.