fix(external-link): strip whitespace inside external anchors + enforce lint rule - #1885
Draft
caugner wants to merge 2 commits into
Draft
fix(external-link): strip whitespace inside external anchors + enforce lint rule#1885caugner wants to merge 2 commits into
caugner wants to merge 2 commits into
Conversation
Contributor
|
56cdf09 was deployed to: https://fred-pr1885.review.mdn.allizom.net/ |
caugner
force-pushed
the
external-link-whitespace
branch
from
September 10, 2026 12:20
8043d9d to
e110fe5
Compare
caugner
added this pull request to stack #1887
September 10, 2026 12:20
Prettier wrapped the link text of 14 `class="external"` anchors onto its own line, and Lit SSR preserves that whitespace, so the external-link icon wrapped onto the next line. Use the `>text</a` form with the closing `>` on its own line, which Prettier keeps as-is.
caugner
force-pushed
the
external-link-whitespace
branch
from
September 10, 2026 12:49
e110fe5 to
2e7fb9e
Compare
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.
Description
Fix 14
class="external"anchors so their content has no leading or trailing whitespace, using the>text</aform with the closing>on its own line, and elevatefred/no-external-link-whitespacefromwarntoerror.Motivation
Prevent the external-link icon (
components/external-link/global.css) from wrapping onto the next line. Prettier wrapped the link text onto its own line, and Lit SSR preserves that whitespace. With the violations fixed, the rule can be enforced as an error.Additional details
The anchor changes are the rule's autofix output (
npx eslint --fix components hooks) followed by Prettier. Affected components: advertising, blog, compat-table, curriculum-landing, footer, observatory-results, scrim-inline.Related issues and pull requests
Depends on: #1886.