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

RevealJS: Unexpected behavior from blockquoted unordered lists #7715

Closed
mfisher87 opened this issue Nov 26, 2023 · 3 comments · Fixed by #10659
Closed

RevealJS: Unexpected behavior from blockquoted unordered lists #7715

mfisher87 opened this issue Nov 26, 2023 · 3 comments · Fixed by #10659
Assignees
Labels
documentation Doc improvements & quarto-web pandoc revealjs Issues with the revealjs format
Milestone

Comments

@mfisher87
Copy link

mfisher87 commented Nov 26, 2023

Bug description

In RevealJS format, blockquoting an unordered list (and nothing else; putting other things in the blockquote may prevent this from reproducing) causes the unordered list to be rendered as an incremental list without blockquote styling.

I think this is an issue with Pandoc possibly, but I'm not sure. I felt having an issue on this repo would be helpful for other Quarto users searching for info about this behavior. I feel somewhat surprised that I've had difficulty finding previous reports of this behavior. It doesn't seem that uncommon to want to blockquote a list. I apologize if I've missed something obvious before submitting this report!

Steps to reproduce

See repro repo: https://github.com/mfisher87/sscce-quarto-revealjs-blockquoted-list-weirdness

Deployed repro: https://mfisher87.github.io/sscce-quarto-revealjs-blockquoted-list-weirdness

Render a blockquoted list as revealjs format (revealjs: default):

## Repro

```markdown
> * Foo
> * Bar
```

> * Foo
> * Bar

Can you see "Foo" or "Bar"? Try advancing the slide.

Expected behavior

I expected the list would render normally, but styled like a blockquote.

Actual behavior

List renders without blockquote style, but renders incrementally (starts hidden, shows each list item as you advance the slide).

The list also renders in unexpected ways relative to other elements in the slide, for example, when rendered next to an un-blockquoted list, the two lists render side-by-side instead of one beneath the other.

Reproduced with Quarto versions:

  • 1.3.450
  • 1.3.433
  • 1.4.510

Your environment

OS: Pop!_OS 22

Quarto check output

$ quarto check
Quarto 1.4.510
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.9: 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.510
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2023.11
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/robatt/.TinyTeX/bin/x86_64-linux
      Version: 2023

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.9 (Conda)
      Path: /home/robatt/.local/share/miniconda3/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

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

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
@mfisher87 mfisher87 added the bug Something isn't working label Nov 26, 2023
@mfisher87 mfisher87 changed the title Unexpected/unintuitive behavior from blockquoted unordered lists RevealJS: Unexpected behavior from blockquoted unordered lists Nov 26, 2023
@cscheid cscheid added the revealjs Issues with the revealjs format label Nov 27, 2023
@cscheid cscheid added the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Nov 27, 2023
@cderv
Copy link
Collaborator

cderv commented Nov 29, 2023

I think this is an issue with Pandoc possibly, but I'm not sure.

Yes this is Pandoc's bahevior which adds a fragment class on each item. You could have tested this way:

> quarto pandoc --to revealjs
> * Foo
> * Bar
^Z
<section class="slide level6">

<ul>
<li class="fragment">Foo</li>
<li class="fragment">Bar</li>
</ul>
</section>

I believe this is expected behavior by Pandoc's documentation at https://pandoc.org/MANUAL.html#incremental-lists
See last past part of the doc saying: " an older method is also supported: putting lists inside a blockquote will depart from the document default"

Extract from Doc
While using incremental and nonincremental divs is the recommended method of setting incremental lists on a per-case basis, an older method is also supported: putting lists inside a blockquote will depart from the document default (that is, it will display incrementally without the [-i](https://pandoc.org/MANUAL.html#option--incremental[) option and all at once with the [-i](https://pandoc.org/MANUAL.html#option--incremental[) option):

> - Eat spaghetti
> - Drink wine
Both methods allow incremental and nonincremental lists to be mixed in a single document.

If you want to include a block-quoted list, you can work around this behavior by putting the list inside a fenced div, so that it is not the direct child of the block quote:

> ::: wrapper
> - a
> - list in a quote
> :::

Unfortunately, it seems this was the old syntax used by Pandoc from incremental before --incremental flag was added.

So you need the trick to wrap in nonincremental, or add content in the blockquote.

Note sure Quarto should change this default (even if I am not sure we want it). @cscheid what do you think ? Would it worth patching so that BulletList is not first Item of BlockQuote when inside revealjs ? If we did then it would not trigger the fragment.

> quarto pandoc --to native
> * Foo
> * Bar
^Z
[ BlockQuote
    [ BulletList
        [ [ Plain [ Str "Foo" ] ] , [ Plain [ Str "Bar" ] ] ]
    ]
]

Something patched with this Lua

BlockQuote = function(b)
  if #b.content and b.content[1].t == "BulletList" then
    b.content = pandoc.Div(b.content)
    return b
  end
end

Revealjs post processing is also possible - we do already some and removing fragment class in there could be possible.

I am inclined to make this behavior not work for Quarto, but we would be touching a Pandoc ones. Interested by your thoughts.

@cderv cderv added triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. pandoc and removed triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. bug Something isn't working labels Nov 29, 2023
@cderv cderv added this to the v1.5 milestone Nov 29, 2023
@cderv cderv removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Nov 29, 2023
@mfisher87
Copy link
Author

mfisher87 commented Nov 29, 2023

> quarto pandoc --to revealjs
> * Foo
> * Bar

☝️ This is new to me! So much easier than making a project file. Thanks 😁

I am inclined to make this behavior not work for Quarto, but we would be touching a Pandoc ones. Interested by your thoughts.

I like this idea. As an alternative, we could add a callout-warning to the Quarto RevealJS doc page on incremental lists? I think many users (like myself) would scour Quarto docs for information about this symptom first, and it would take a long time (or a help request ;) ) to find the same info in the Pandoc docs.

Updating the docs is something we could do now (let me know and I'll open a PR!), and if the behavior is disabled in Quarto 1.5 we could remove the callout. What do you think?

@cscheid
Copy link
Collaborator

cscheid commented Feb 26, 2024

As an alternative, we could add a callout-warning to the Quarto RevealJS doc page on incremental lists?

I think this is the correct way to do it. Every decision we make to behave differently from Pandoc is a decision to maintain and explain the difference, and however annoying this old feature is, it will be even more annoying for people who know about it if we choose to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Doc improvements & quarto-web pandoc revealjs Issues with the revealjs format
Projects
None yet
3 participants