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: filter script and style elements from search result summary text. #12057

Conversation

jayaddison
Copy link
Contributor

@jayaddison jayaddison commented Mar 9, 2024

Feature or Bugfix

  • Bugfix

Purpose

  • Filters-out the text content of <script> and <style> elements from the summary snippets displayed during search within Sphinx.

Detail

  • Also adds test coverage to demonstrate that HTML comments are not included in search result summaries.

Relates

@jayaddison jayaddison changed the title HTML search: filter script elements from search result summary text. HTML search: filter script and style elements from search result summary text. Mar 9, 2024
@jayaddison jayaddison changed the title HTML search: filter script and style elements from search result summary text. HTML Search: filter script and style elements from search result summary text. Mar 14, 2024
@jayaddison jayaddison added awaiting:response Waiting for a response from the author of this issue awaiting:review PR waiting for a review by a maintainer. and removed awaiting:response Waiting for a response from the author of this issue labels Mar 14, 2024
@picnixz
Copy link
Member

picnixz commented Mar 17, 2024

@jayaddison Is this one fine?

sphinx/themes/basic/static/searchtools.js Outdated Show resolved Hide resolved
@picnixz picnixz added priority:high and removed awaiting:review PR waiting for a review by a maintainer. labels Mar 17, 2024
@jayaddison
Copy link
Contributor Author

@jayaddison Is this one fine?

Yes, this one is ready 👍 Thank you for the review.

@picnixz
Copy link
Member

picnixz commented Mar 17, 2024

Thank you!

@picnixz picnixz merged commit bf0bec3 into sphinx-doc:master Mar 17, 2024
23 checks passed
@jayaddison
Copy link
Contributor Author

Thanks again!

@jayaddison jayaddison deleted the issue-12052/search-result-summary-html-filtering branch March 17, 2024 14:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
@AA-Turner AA-Turner added this to the 7.3.0 milestone Jul 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
html search javascript Pull requests that update Javascript code type:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search: don't show content of raw HTML <script> tags (and maybe others) in search preview
3 participants