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

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Mikey O'Toole 2023-06-30 14:39:07 +01:00 committed by GitHub
parent 9391a33c41
commit c8e7ce33f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,11 @@ import type {Props} from '@theme/MDXComponents/Ul';
import styles from './styles.module.css';
function transformUlClassName(className?: string): string {
function transformUlClassName(className?: string): string | undefined {
// Fix https://github.com/facebook/docusaurus/issues/9098
if (typeof className === 'undefined') {
return undefined;
}
return clsx(
className,
// This class is set globally by GitHub/MDX. We keep the global class, and