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(gatsby-plugin-mdx): Default remark node to span #37423

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

tyhopp
Copy link
Contributor

@tyhopp tyhopp commented Jan 9, 2023

Description

Change the wrapping element type we generate when handling html nodes from div to span so that remark plugins can handle inline elements.

This avoids situations where the generated div becomes a child of elements with a phrasing content model like <p>, which is invalid HTML.

Nice explanation of this I found - https://stackoverflow.com/questions/8397852/why-cant-the-p-tag-contain-a-div-tag-inside-it/34683474#34683474

Documentation

N/A

Related Issues

Resolves #37292

@tyhopp tyhopp added the topic: remark/mdx Related to Markdown, remark & MDX ecosystem label Jan 9, 2023
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 9, 2023
@tyhopp tyhopp removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 9, 2023
@LekoArts LekoArts merged commit 824e3de into master Jan 9, 2023
@LekoArts LekoArts deleted the fix/remark-mdx-plugin-default-block-level branch January 9, 2023 07:24
leobang17 added a commit to leobang17/gatsby-theme-simplex that referenced this pull request Mar 11, 2023
- gatsby-plugin-mdx 의존성 최신버전으로 업데이트
  - 기존의 파서가 `` inline code를 <span> tag가 아닌 <div> tag로 변환하고 있었음.
  - gatsbyjs/gatsby#37423
  - 해당 PR을 통해 정상적으로 고쳐짐 -> 해당 버전으로 업데이트

- codeblock theme을 위한 의존성 설치
  - prism-themes
  - remark-gfm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: remark/mdx Related to Markdown, remark & MDX ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gatsby-remark-prismjs] Inline code is put into <div> tags, breaking formatting and hydration
2 participants