quarto-dev / quarto-cli

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

visual editor moves letters onto new line when footnotes are in bullet points of revealjs slide #10564

Open Aariq opened 3 months ago

Aariq commented 3 months ago

Bug description

Sorry for the long title, but this one is so weird to describe. In a revealjs document, with cannonical markdown used, when a slide has more than one bullet point and the last bullet has more than 1 footote, the last number-of-footnotes minus 1 letters of the last word of the bullet point get moved to a new line when the document is saved.

Steps to reproduce

Save this document...

---
title: "Untitled"
format: revealjs
editor: 
  markdown:
    canonical: true
---

## Slide title

-   A bullet point

-   Some text with footnotes[^1], and other footnotes[^2], a third one [^3], and A final word

[^1]: test

[^2]: test

[^3]: test

And you'll get this:

---
title: "Untitled"
format: revealjs
editor: 
  markdown:
    canonical: true
---

## Slide title

-   A bullet point

-   Some text with footnotes[^1], and other footnotes[^2], a third one [^3], and A final wo
    rd

[^1]: test

[^2]: test

[^3]: test

Expected behavior

Cannonical markdown/visual editor should not split part of a word onto a new line

Actual behavior

Last word gets split with some letters moved onto new line

Your environment

Quarto check output

Quarto 1.4.554
[✓] 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.554
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.03.13
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/ericscott/Library/TinyTeX/bin/universal-darwin
      Version: 2024

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.9 (Conda)
      Path: /usr/local/Caskroom/miniconda/base/bin/python
      Jupyter: 5.3.0
      Kernels: python3

(\) Checking Jupyter engine render....Traceback (most recent call last):
  File "/Applications/quarto/share/jupyter/jupyter.py", line 21, in <module>
    from notebook import notebook_execute, RestartKernel
  File "/Applications/quarto/share/jupyter/notebook.py", line 14, in <module>
    from yaml import safe_load
ModuleNotFoundError: No module named 'yaml'
[✓] Checking Jupyter engine render....OK
cscheid commented 3 months ago

That's not good -

Before we go any further, can you try adding

editor:
  markdown:
    wrap: 250

to your document? I want to rule out the line wrapping here.

Aariq commented 3 months ago

It behaves normally (no splitting of "word") with either

editor: 
  markdown:
    canonical: true
    wrap: 250

or

editor: 
  markdown:
    wrap: 250
Aariq commented 3 months ago

And just to be clear, the number of letters moved to the next line depends on the number of footnotes in that last bullet point. That feels like it should be a clue, but I have no idea what it means. I.e. with two footnotes you get "wor d", with three you get "wo rd", with four you get "w ord".

cscheid commented 3 months ago

Yeah ok, this is definitely a bug in the word-wrapping behavior.

The visual editor code is in quarto-dev/quarto, so we might want to send this bug there. (I'll do that when appropriate, no action needed on your part)