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

fix(theme): only set classname on ul elements if they have an existing class #9099

Merged
merged 3 commits into from Jun 30, 2023

Conversation

homotechsual
Copy link
Contributor

@homotechsual homotechsual commented Jun 23, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Fix #9098

Test Plan

Test links

Deploy preview: https://deploy-preview-9099--docusaurus-2.netlify.app/

Related issues/PRs

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 23, 2023
@slorber slorber changed the title fix: only set classname on ul elements if they have an existing class. closes #9098 fix(theme): only set classname on ul elements if they have an existing class Jun 23, 2023
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jun 23, 2023
@netlify
Copy link

netlify bot commented Jun 23, 2023

[V2]

Name Link
🔨 Latest commit 32869fd
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/649ed4032f1c4d00080cad7b
😎 Deploy Preview https://deploy-preview-9099--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions
Copy link

github-actions bot commented Jun 23, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 62 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 76 🟢 100 🟢 92 🟢 100 🟠 89 Report

function transformUlClassName(className?: string): string {
function transformUlClassName(className?: string): string | undefined {
// Fix https://github.com/facebook/docusaurus/issues/9098
if (typeof className === 'undefined') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

using typeof because if props.className is '' we probably still want to have class='' in the final html, although it's a weird edge-case

@slorber slorber added the to backport This PR is planned to be backported to a stable version of Docusaurus label Jun 30, 2023
@slorber slorber merged commit c8e7ce3 into facebook:main Jun 30, 2023
26 of 31 checks passed
slorber added a commit that referenced this pull request Sep 20, 2023
…g class (#9099)

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
slorber added a commit that referenced this pull request Sep 20, 2023
…lease (#9324)

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: Ori Shalom <ori-shalom@users.noreply.github.com>
Co-authored-by: Mikey O'Toole <mikey@homotechsual.dev>
Co-authored-by: TheCatLady <52870424+TheCatLady@users.noreply.github.com>
fix flaky screenshots, add html data-has-hydrated attribute (#9256)
fix(theme-common): ThemedComponent should display something when JS is disabled (#9243)
fix(theme): canonical url should be not change after hydration if url accessed with/without trailing slash (#9130)
fix(theme): only set classname on ul elements if they have an existing class (#9099)
fix(content-docs): sidebar generator should return customProps for doc items (#9107)
@slorber slorber added backported This PR has been backported to a stable version of Docusaurus and removed pr: bug fix This PR fixes a bug in a past release. labels Sep 21, 2023
@slorber slorber removed the to backport This PR is planned to be backported to a stable version of Docusaurus label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR has been backported to a stable version of Docusaurus CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding empty class attribute to <ul>
3 participants