Skip to content

Cross-reference label formatting results in unexpected text before callouts #8

Closed
@gyu-eun-lee

Description

@gyu-eun-lee

Summary:

Using a hyphenated cross-reference label like #thm-reference results in extra text preceding the callout when rendered.

Description:

custom-numbered-blocks behaves as expected when cross-reference labels are formatted as a single word, such as #thmRef. But when labels are formatted with hyphens like #thm-ref, as suggested in the Quarto cross-reference documentation, the resulting rendered output precedes the numbered block with a previous numbered block's label.

custom_numbered_bug_report

Steps to reproduce:

  1. Open a new Quarto book project.
  2. Install custom-numbered-blocks extension.
  3. Configure extension in _quarto.yml as follows:
project:
  type: book

book:
  title: "Bug Report"
  chapters:
    - index.qmd

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

filters:
  - custom-numbered-blocks
custom-numbered-blocks:
  groups:
    thmlike:
      colors: [948bde, 584eab]
      boxstyle: foldbox.simple
      collapse: false
  classes:
    Theorem:
      group: thmlike
  1. Edit index.qmd as follows:
# Index

::: {.Theorem #thmRef}

This theorem has citation key `#thmRef`. It exhibits expected numbering behavior.

:::

Filler text

::: {.Theorem #thm-Ref}

This theorem has citation key `#thm-Ref`. It results in the block being preceded by the text **Theorem 1.1.**

:::

More filler text

::: {.Theorem #thm-Ref2}

This theorem has citation key `#thm-Ref2`. It results in the block being preceded by the text **Theorem 1.2.**

:::

Actual result:

Numbered blocks with hyphenated labels are preceded by unexpected text.

Expected result:

Numbered blocks with hyphenated labels behave identically to blocks with non-hyphenated labels.

[>] 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.450
      Path: C:\Users\<User>\AppData\Local\Programs\Quarto\bin
      CodePage: 949

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions