web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.21k stars 107 forks source link

fix: page crashes if Tabs has single Tab child #972

Closed chenjiahan closed 2 months ago

chenjiahan commented 2 months ago

Summary

Fix page crashes if Tabs has single Tab child.

Related Issue

https://github.com/web-infra-dev/rspress/issues/971

Checklist

netlify[bot] commented 2 months ago

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
Latest commit ee90a5e7d53a09e65536ab7c4e25e7c6ad35e102
Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/66208f7e54c77000086c944b
Deploy Preview https://deploy-preview-972--aquamarine-blini-95325f.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 93 (🟢 up 11 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Timeless0911 commented 2 months ago

If we write like this

<Tabs tabContainerClassName="tabs-b">
  <Tab label="label2">content2</Tab>
  <Tab label="label3">content3</Tab>
</Tabs>

It contains a newline character in the middle of two <Tab>

image

We should filter the children array to remove the '\n' element