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

fix: decode href before using as query selector #951

Merged
merged 1 commit into from Jul 8, 2022

Conversation

brc-dd
Copy link
Member

@brc-dd brc-dd commented Jul 8, 2022

fixes #950

@gyhyfj
Copy link
Contributor

gyhyfj commented Jul 19, 2022

Could it work if the h2 title start with special char?
Such as+ -

@brc-dd
Copy link
Member Author

brc-dd commented Jul 19, 2022

@gyhyfj Is it not working?

@gyhyfj
Copy link
Contributor

gyhyfj commented Jul 21, 2022

It doesn't work well at "vitepress": "^1.0.0-alpha.1".
For example:
The md file is like this:

# Reading
...
... 
## `- + * /`
...
...

If I click toc in .VPDocAsideOutline , on the right side of the web,
the page can't scroll to the right place as usual.
Chrome terminal report :

DOMException: Failed to execute 'querySelector' on 'Document': '#-5' is not a valid selector.
    at c (https://www.gyhyfj.com/assets/app.4bd937d4.js:1:124560)
    at $t (https://www.gyhyfj.com/assets/app.4bd937d4.js:1:12734)
    at qe (https://www.gyhyfj.com/assets/app.4bd937d4.js:1:12813)
    at HTMLAnchorElement.n (https://www.gyhyfj.com/assets/app.4bd937d4.js:1:56875)

@brc-dd
Copy link
Member Author

brc-dd commented Jul 21, 2022

Hey can you create a seperate issue for this one. It's probably because we cannot auto generate an id from that heading. You can try something like

## `- + * /` {#foo}

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If the VPDocAsideOutline switch is in Chinese, the parsing will be wrong
2 participants