Fix: Use getElementById instead of querySelector to work with all valid characters (#1902)

responseInfo.pathInfo.anchor is assumed to be an ID here, so use getElementById instead of querySelector, which doesn't accept all valid characters (for example parentheses)
This commit is contained in:
Jyri-Matti Lähteenmäki 2023-10-26 21:00:00 +03:00 committed by GitHub
parent a679244c40
commit 1040ace093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3551,7 +3551,7 @@ return (function () {
}
}
if (responseInfo.pathInfo.anchor) {
var anchorTarget = find("#" + responseInfo.pathInfo.anchor);
var anchorTarget = getDocument().getElementById(responseInfo.pathInfo.anchor);
if(anchorTarget) {
anchorTarget.scrollIntoView({block:'start', behavior: "auto"});
}