Repository navigation
fix(docs): only show feedback button on prose - #82
Merged
Merged
Conversation
The feedback widget attached a button to every list item and link-only paragraph, so the GitHub/pkg.go.dev header links and every table-of- contents entry sprouted noisy feedback buttons with nothing to comment on. Filter the candidates to prose: skip anything inside a <nav> (the table of contents) and any element whose entire text is a single link. A list item with prose around a link keeps its button. Signed-off-by: Alex Suraci <[email protected]>
Deploying dang with
|
| Latest commit: |
1565f24
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://32a086db.dang-3kk.pages.dev |
| Branch Preview URL: | https://docs-feedback-prose-filter.dang-3kk.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feedback
(page:
/)Change
The widget attached a feedback button to every
main li/main p, so the GitHub / pkg.go.dev header links (rendered as<p><a>…</a></p>) and every table-of-contents entry got a button with nothing to comment on.Added an
isProse()filter applied before attaching. An element is skipped when:<nav>— that's the table of contents, so all TOC entries are covered at once; orA genuine prose item that contains a link is kept, since its text is more than the link's — e.g.
see <a>Functions</a> for the full set. Verified against the built HTML: the only site-wide single-link items outside<nav>are exactly GitHub and pkg.go.dev.