Skip to content

Conversation

@hntk03
Copy link

@hntk03 hntk03 commented Nov 14, 2025

Purpose

This PR ensures that URLs in search results are properly encoded.
Previously, search result URLs containing characters such as # or ? were not encoded correctly.
This change adds URL encoding in the _displayItem of search results to fix this issue.

References

}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
const encodedLinkUrl = linkUrl.split("/").map(encodeURIComponent).join("/");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for linkUrl to contain other components that we would not want to URL-encode? (for example, protocol scheme - http://, or similar?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search results don't link correctly if the url contains a "#"

2 participants