Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links to span do not work (typeset likely to blame) #5241

Closed
4 tasks done
jaceklaskowski opened this issue Mar 22, 2023 · 4 comments
Closed
4 tasks done

Links to span do not work (typeset likely to blame) #5241

jaceklaskowski opened this issue Mar 22, 2023 · 4 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@jaceklaskowski
Copy link
Sponsor

jaceklaskowski commented Mar 22, 2023

Bug description

Links (hrefs) to span elements stopped working after typeset plugin got enabled.

Related links

Reproduction

mkdocs-material-repro.zip

Steps to reproduce

  1. Unzip the reproduction package
  2. Enable typeset plugin in mkdocs.yml and click any link on the index page. They do not lead to corresponding span sections.

Browser

Chrome

Before submitting

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Mar 22, 2023
@squidfunk
Copy link
Owner

Thanks for reporting. I would kindly ask you to use the built-in info plugin as mentioned in our bug reporting guidelines and this issue template the next time, as it contains essential information on the runtime and environment, as well as installed packages. I'll try to investigate this issue nonetheless, but it makes my work more challenging.

@squidfunk
Copy link
Owner

Confirmed, this is related to the built-in typeset plugin, which keeps the custom elements with id attributes inside the headlines. While this is not intended (= we must remove them), I understand that you want to set custom id values for headlines, correct? The idiomatic way to do this is to use the Attribute Lists extension:

## What is Lorem Ipsum? { #s1 }

This also means no further element is necessary and will fix the problem reported.

@squidfunk squidfunk added bug Issue reports a bug and removed needs investigation Issue must be investigated by the maintainers labels Mar 24, 2023
@squidfunk
Copy link
Owner

Fixed in 5ae0aaefb. The typeset plugin should now remove all ids inside the content of headlines (which have ids themselves as mentioned above) before injecting them into the table of contents or navigation. This will ensure that ids are unique and restore linking functionality. However, as said in #5241 (comment), Attribute Lists are a better bet 😀

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Mar 24, 2023
@squidfunk squidfunk reopened this Mar 24, 2023
@squidfunk
Copy link
Owner

Released as part of 9.1.4-insiders-4.32.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants