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

[search] Nitpick post-merge adjustments for #11944 (anchored search result summary retrieval). #12105

Conversation

jayaddison
Copy link
Contributor

Feature or Bugfix

  • Nitpick / safety.

Purpose

  • Restricts the area of the page that search result summaries can be displayed from to the expected document content area.

Detail

  • When finding content to display as search result summaries, constrain the search for the anchor to within the [role=main] part of the page.

Relates

@picnixz
Copy link
Member

picnixz commented Mar 16, 2024

Do you think there could be themes that don't have this assumption? or is it possible to have something outside of the main block?

@jayaddison
Copy link
Contributor Author

It's difficult to think of a problem that could occur, and I don't know of any examples - but I think that browser extensions inject elements with fixed identifiers, and there can be adverts/other elements on some pages that should not be displayed in search results.

I can't think how it would go badly wrong -- it would only be content that is already genuinely on the user's page when they run a search -- but I'd feel marginally better about the code if it only queries within the expected area.

@picnixz
Copy link
Member

picnixz commented Mar 16, 2024

I can live with this.

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

Thank you!

@jayaddison jayaddison deleted the pr-11944-followup/pedantic-filtering-suggestion branch March 16, 2024 10:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants