Skip to content

[[TOC]] links broken with Badges #1985

Open
@brindosch

Description

@brindosch
  • I confirm that this is an issue rather than a question.

Bug report

If [[TOC]] is used in a page where a header has a badge, the link contains also the badge content.

Steps to reproduce

  • Add header to page: ### TEXT <Badge text="TBA 2.1+"/>
  • Add [[TOC]] to page
  • The TOC link to ### TEXT will be #text-badge-text-tba-2-1 instead of #text

What is expected?

  • Badges should not break the link

What is actually happening?

  • TOC links to headers with badges are broken

Other relevant information

  • Output of npx vuepress info in my VuePress project:

    System:
    OS: Linux 4.4 Ubuntu 16.04.6 LTS (Xenial Xerus)
    CPU: (4) x64 Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
    Binaries:
    Node: 12.11.1 - /usr/bin/node
    Yarn: 1.19.1 - /usr/bin/yarn
    npm: 6.11.3 - /usr/bin/npm
    Browsers:
    Chrome: Not Found
    Firefox: 70.0
    npmPackages:
    @vuepress/core: 1.2.0
    @vuepress/theme-default: 1.2.0
    vuepress: ^1.2.0 => 1.2.0
    npmGlobalPackages:
    vuepress: Not Found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions