Skip to content

format-links create a new link instead of renaming #9606

Closed

Description

@mcanouil
Quarto documentHTML
---
title: "Demo"
format:
  html: default
  typst: default
format-links:
  - format: typst
    text: Whatever
---

{{< lipsum 1 >}}
image

FYI, it was first reported in #8610 (comment)

Activity

  1. added
    bugSomething isn't working
    htmlIssues with HTML and related web technology (html/css/scss/js)
    on May 7, 2024
  2. added this to the Future milestone on May 7, 2024
  3. cderv commented on May 14, 2024

    @cderv
    Member

    Current workaround is to add all formats into the format-links part, including html

    ---
    title: "Demo"
    format:
      html: default
      typst: default
    format-links:
      - html
      - format: typst
        text: Whatever
    ---
    
    {{< lipsum 1 >}}
    

    image

    Probably filtering would be better, but this is currently how it works

  4. cderv commented on Nov 6, 2026

    @cderv
    Member

    I can still reproduce this with 1.11.9 and the 1.12.0 prerelease. It also happens when format-links is set under format: html:, with several formats:

    format:
      html:
        format-links:
          - format: typst
            text: PDF
            icon: file-pdf
          - format: docx
            text: Word
            icon: file-word
      typst: default
      docx: default

    "Other Formats" shows PDF, Word, Typst, MS Word.

    The default links are added unless one entry is a plain string, and {format: ...} entries are not counted:

    const userLinksHasFormat = userLinks &&
    userLinks.some((link) => typeof link === "string");
    if (!userLinksHasFormat) {
    formats.forEach((renderedFormat) => {
    const baseFormat = renderedFormat.format.identifier["base-format"];
    if (!kExcludeFormatUnlessExplicit.includes(baseFormat || "html")) {
    alternateLinks.push(alternateLinkForFormat(renderedFormat, count));
    }
    count++;
    });
    }

    This check dates from when the {format, text} form was added (6b62246), so not a regression. We could count entries with a format key too, so that listing any format in format-links replaces the default list.

    The - html workaround above still works with 1.12.0. Writing the format itself as a plain string (- docx) also removes the duplicates, but that link then keeps its default name.

  5. cderv commented on Nov 6, 2026

    @cderv
    Member

    I opened #15312 for this. With it, a {format, text} entry renames the link of that format instead of adding a second one. Other rendered formats keep their default link, so the original example shows only "Whatever".

    I didn't go with counting format entries like plain format names, as I suggested above, because that would also drop the links to every rendered format not listed, and some documents rely on them. To show only some formats, add them as plain strings in format-links, as today.

  6. modified the milestones: Future, v1.12 on Nov 6, 2026
  7. added a commit that references this issue on Nov 6, 2026
    38e34ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions