### Bug description

# Issue

When using a top or right navigation bar (non-default) and the generated PDF filename has consecutive hyphens such as `--` or `---`, those are incorrectly encoded as en and em hyphens in the PDF URL link.  For example, the below Quarto Book titled `Test: A Book` will render a PDF named:

```sh
$ ls _book/*.pdf
_book/Test--A-Book.pdf
```

because space (` `) is encoded as a hyphen (`-`) and so is colon (`:`), which results in `--` in the PDF filename.

However, the link produced in the HTML version of the book, encodes `--` as an en hyphen (–), resulting in a link to `./Test–A-Book.pdf` (= `Test%E2%80%93A-Book.pdf`);

```html
$ grep "Download PDF" _book/index.html
    <a href="./Test–A-Book.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
```


# Reproducible example

```sh
quarto create project book test-book
cd test-book
emacs _quarto.yml   ## edit as below example
quarto render
quarto preview
```

`_quarto.yml`:

```yaml
project:
  type: book

book:
  title: "Test: A Book"
  author: "Norah Jones"
  date: "5/19/2023"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd
  downloads: [pdf]
  navbar:
    top:
      - icon: github

bibliography: references.bib

format:
  html:
    theme: cosmo
  pdf:
    documentclass: scrreprt
```


Note that the URL is indeed correct when using the default navbar, i.e. without the custom:

```sh
  navbar:
    top:
      - icon: github
```



# Session info

This is on an up-to-date Ubuntu 22.04 Linux machine:

```sh
$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.340
      Path: /home/henrik/shared/software/CBI/quarto-1.3.340/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      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.0
      Path: /home/henrik/shared/software/CBI/R-4.3.0-gcc11/lib/R
      LibPaths:
        - /home/henrik/R/x86_64-pc-linux-gnu-library/4.3-CBI-gcc11
        - /home/henrik/shared/software/CBI/R-4.3.0-gcc11/lib/R/library
      knitr: 1.42
      rmarkdown: 2.21

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


### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
- [X] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
dragonstyle
2023-05-20T01:09:49Z
HenrikBengtsson
bug
v1.4
open
Link to PDF in HTML Book incorrectly encodes -- and --- in PDF filename to en and em hyphens
https://github.com/quarto-dev/quarto-cli/issues/5615