quarto-dev / quarto-dev/quarto

Automatic footnote identifier prefixing normalizes filenames imperfectly

Open
#424 0 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Apr 25, 2024.

Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

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 argument[^s]. 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).

[^s]: I think this is the place where Quarto passes the ID prefix value on to Pandoc.

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.