-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
help wantedIssue with a clear description that the community can help with.Issue with a clear description that the community can help with.status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: remark/mdxRelated to Markdown, remark & MDX ecosystemRelated to Markdown, remark & MDX ecosystemtype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby
Milestone
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
When using gatsby-remark-images along with the showCaptions feature, it creates a figure element which is nested inside a p, which is not valid HTML.
This issue has been reported before: #16239
The latest comment on that issue said to open a new bug if this still exists in Gatsby 4, so I have created minimal reproduction from gatsby-starter-blog and setting showCaptions to true.
Reproduction Link
https://github.com/schwigri/gatsby-starter-blog
Steps to Reproduce
npm run developornpm run build && npm run serve- See the HTML for the post "Hello World"
- The image with the eggs will be a
figureelement that is nested inside apelement. - Please view the raw HTML itself; modern browser realizes that this is incorrect and moves the figure outside of the paragraph, leaving an empty paragraph so the dev tools will show it like
<p></p><figure />
Expected Result
<figure />
Actual Result
<p>
<figure />
</p>
Environment
System:
OS: Linux 5.18 Arch Linux
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Languages:
Python: 3.10.5 - /usr/bin/python
Browsers:
Firefox: 102.0.1
npmPackages:
gatsby: ^4.19.2 => 4.19.2
gatsby-plugin-feed: ^4.19.0 => 4.19.0
gatsby-plugin-gatsby-cloud: ^4.19.0 => 4.19.0
gatsby-plugin-google-analytics: ^4.19.0 => 4.19.0
gatsby-plugin-image: ^2.19.0 => 2.19.0
gatsby-plugin-manifest: ^4.19.0 => 4.19.0
gatsby-plugin-offline: ^5.19.0 => 5.19.0
gatsby-plugin-react-helmet: ^5.19.0 => 5.19.0
gatsby-plugin-sharp: ^4.19.0 => 4.19.0
gatsby-remark-copy-linked-files: ^5.19.0 => 5.19.0
gatsby-remark-images: ^6.19.0 => 6.19.0
gatsby-remark-prismjs: ^6.19.0 => 6.19.0
gatsby-remark-responsive-iframe: ^5.19.0 => 5.19.0
gatsby-remark-smartypants: ^5.19.0 => 5.19.0
gatsby-source-filesystem: ^4.19.0 => 4.19.0
gatsby-transformer-remark: ^5.19.0 => 5.19.0
gatsby-transformer-sharp: ^4.19.0 => 4.19.0Config Flags
No response
Metadata
Metadata
Assignees
Labels
help wantedIssue with a clear description that the community can help with.Issue with a clear description that the community can help with.status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.Issue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: remark/mdxRelated to Markdown, remark & MDX ecosystemRelated to Markdown, remark & MDX ecosystemtype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby