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

Automatic footnote identifier prefixing normalizes filenames imperfectly #424

Open
salim-b opened this issue Apr 24, 2024 · 0 comments
Open
Assignees

Comments

@salim-b
Copy link

salim-b commented Apr 24, 2024

Bug description

RStudio’s Markdown canonicalization, which is provided by Quarto, adds a normalized version of the edited file's name as footnote (and other) identifiers via Pandoc's --id-prefix CLI argument1. This is a good thing, in principle.

But the filename normalization is very imperfect, I recently discovered. It should be extended to also normalize (i.e. remove) the special characters it currently doesn't touch. See below for an example (note that it is by no means exhaustive, I just typed special characters until I lost interest).

Steps to reproduce

  1. Create a text file named such.a <[{(weird)}]>|@#§°\&%$£:;*+"´`'~=filename - – — RIGHT?!.md (this is a totally valid filename on Linux).

  2. Paste some Markdown content including at least one footnote in it.

  3. Open the file in RStudio and click on Visual editor mode, then switch back to Source editor mode and look at the first footnote identifier.

Expected behavior

Quarto should normalize the above filename to the (footnote) ID prefix:

[^such.a-weirdfilename-----right-1]

Actual behavior

Quarto actually normalizes the above filename to the (footnote) ID prefix:

[^such.a-(weird§°£´filename---–-—-right-1]

Your environment

  • IDE: 2023.12.1+402
  • OS: Ubuntu 22.04

Quarto check output

Quarto 1.4.553
[✓] 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.553
      Path: /opt/quarto/bin

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

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /home/salim/.local/bin
      Version: 2024

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.12
      Path: /usr/bin/python3
      Jupyter: (None)

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

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /usr/lib/R
      LibPaths:
        - /home/salim/.software/managed/r
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.46
      rmarkdown: 2.26

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

Related

Footnotes

  1. I think this is the place where Quarto passes the ID prefix value on to Pandoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants