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

HTML Search: Fix removal of unwanted anchor content from search results #12321

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

wlach
Copy link
Contributor

@wlach wlach commented Apr 24, 2024

Subject: Fix removal of unwanted anchor content from search results

Feature or Bugfix

  • Bugfix

Purpose

This was accidentally broken in bf0bec3 (#12057), this just fixes it (and updates the existing test so it hopefully doesn't happen again).

Detail

N/A

Relates

Closes #12320

@@ -178,7 +178,7 @@ const Search = {

htmlToText: (htmlString, anchor) => {
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
for (const removalQuery of [".headerlinks", "script", "style"]) {
for (const removalQuery of [".headerlink", "script", "style"]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was (correctly) spelled .headerlink before.

@wlach
Copy link
Contributor Author

wlach commented Apr 24, 2024

@jayaddison @picnixz Can you take a look? Looks like an accidental regression from some previous work.

Copy link
Contributor

@jayaddison jayaddison left a comment

Choose a reason for hiding this comment

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

Yep, looks good to me - thanks @wlach!

@jayaddison jayaddison added type:bug builder:html html search javascript Pull requests that update Javascript code labels Apr 24, 2024
CHANGES.rst Outdated Show resolved Hide resolved
@AA-Turner AA-Turner merged commit 208f4bc into sphinx-doc:master Apr 24, 2024
24 checks passed
@AA-Turner
Copy link
Member

Thanks Will!

Out of interest, would you be interested in triage permissions, to hopefully make your work on the search features easier?

A

@wlach wlach deleted the fix-headerlink-removal branch April 24, 2024 18:18
@wlach
Copy link
Contributor Author

wlach commented Apr 24, 2024

Out of interest, would you be interested in triage permissions, to hopefully make your work on the search features easier?

Yep, that'd be great! Thanks.

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

Successfully merging this pull request may close these issues.

Search summaries include unwanted anchor content
3 participants