vuepress / vuepress-community

:bulb: Community supported ecosystem for VuePress
https://vuepress-community.netlify.app
MIT License
81 stars 62 forks source link

[Bug Report] TOC links are broken when headings embed badges #57

Closed dlecan closed 3 years ago

dlecan commented 4 years ago

Environment

Package version: latest VuePress version: 1.5.3 OS: Any Browser: Any

Describe the bug

TOC links are broken when headings embed a badge, such as # T1 <Badge text="t1"/>

Instead of the link #t1, the TOC generates the link #t1-badge-text-t1, including the "badge" content (attributes and value).

You can see a live version of this issue here: https://docs.uns.network/uns-use-the-network/cli.html

Just try to click on TOC headings with a green badge.

Steps To Reproduce

[[toc]]

# T1 <Badge text="t1"/>

You can see the generated HTML and the value of href, which prevents to follow the link.

<li>
   <a href="#t1-badge-text-t1">t1<span class="badge tip" style="vertical-align:top;" data-v-76652c5d="">t1</span></a>
</li>

Expected behavior

dlecan commented 4 years ago

Duplicates https://github.com/vuejs/vuepress/issues/1985

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.