Skip to content

Conversation

@nickgros
Copy link
Collaborator

Fix invalid HTML issues in

  • CollapsibleSection
  • MarkdownSynapse

>
<Typography
variant="sectionTitle"
component={'div'}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This component contains divs, so it cannot be a p.

vi.mock('./widget/MarkdownSynapsePlot', () => ({
default: vi
.fn()
.mockReturnValue(<figure data-testid={'MarkdownSynapsePlot'}></figure>),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

figure cannot be in a p, so fix this invalid mock.

Comment on lines -229 to -232
const Tag: keyof JSX.IntrinsicElements | typeof Fragment =
element.tagName.toLowerCase() === 'body'
? Fragment // The component ultimately wraps this content, so if the tag is 'body', we use Fragment to avoid an extra nested element
: (element.tagName.toLowerCase() as keyof JSX.IntrinsicElements)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I previously changed the body element to map to a fragment, but this causes us to add props to the Fragment, which is invalid. Instead, map the body tag directly to the wrapper element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant