Skip to content

Fix invalid SVG syntax #39669

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

Merged
merged 1 commit into from
May 30, 2025
Merged

Fix invalid SVG syntax #39669

merged 1 commit into from
May 30, 2025

Conversation

Josh-Cena
Copy link
Member

This code should be merged with the next few sections

@Josh-Cena Josh-Cena requested a review from a team as a code owner May 25, 2025 10:14
@Josh-Cena Josh-Cena requested review from pepelsbey and removed request for a team May 25, 2025 10:14
@github-actions github-actions bot added Content:SVG SVG docs size/xs [PR only] 0-5 LoC changed labels May 25, 2025
Copy link
Contributor

github-actions bot commented May 25, 2025

Preview URLs

(comment last updated: 2025-05-25 10:43:00)

@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels May 25, 2025
@Josh-Cena Josh-Cena requested a review from bsmth May 28, 2025 07:51
@@ -400,14 +400,13 @@ body {
}
```

```html
```html-nolint
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this a single html block? Works okay for me locally, what do you think?

<svg viewBox="-1 -1 202 40" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <path
      id="smiley"
      d="M50,10 A40,40,1,1,1,50,90 A40,40,1,1,1,50,10 M30,40 Q36,35,42,40 M58,40 Q64,35,70,40 M30,60 Q50,75,70,60 Q50,75,30,60" />
  </defs>

  <rect x="0" y="0" width="60" height="30">
    <title>xMidYMid meet</title>
  </rect>
  <svg
    viewBox="0 0 100 100"
    width="60"
    height="30"
    preserveAspectRatio="xMidYMid meet"
    x="0"
    y="0">
    <use href="#smiley" />
  </svg>

  <rect x="70" y="0" width="60" height="30">
    <title>xMinYMid meet</title>
  </rect>
  <svg
    viewBox="0 0 100 100"
    width="60"
    height="30"
    preserveAspectRatio="xMinYMid meet"
    x="70"
    y="0">
    <use href="#smiley" />
  </svg>

  <rect x="140" y="0" width="60" height="30">
    <title>xMaxYMid meet</title>
  </rect>
  <svg
    viewBox="0 0 100 100"
    width="60"
    height="30"
    preserveAspectRatio="xMaxYMid meet"
    x="140"
    y="0">
    <use href="#smiley" />
  </svg>
</svg>

Copy link
Member Author

Choose a reason for hiding this comment

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

The other examples are split so I think we should keep this split for consistency.

Copy link
Member

Choose a reason for hiding this comment

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

True, ok, let's leave it for now.

@Josh-Cena Josh-Cena merged commit bb1ba99 into mdn:main May 30, 2025
8 checks passed
@Josh-Cena Josh-Cena deleted the fix-syntax branch May 30, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:SVG SVG docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants