Split href before decoding instead of after

Fixes #123228

This fixes the case where `#` appears in the path
This commit is contained in:
Matt Bierner 2021-05-21 14:49:40 -07:00
parent 6af49913c2
commit 6ee883bfa3
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -428,7 +428,8 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
private async onDidClickPreviewLink(href: string) {
let [hrefPath, fragment] = decodeURIComponent(href).split('#');
const [rawPath, fragment] = href.split('#');
let hrefPath = decodeURIComponent(rawPath);
if (hrefPath[0] !== '/') {
// We perviously already resolve absolute paths.