fix(Markdown): forward the react-markdown options it accepts - #3105
Open
Lisa18289 wants to merge 2 commits into
Open
fix(Markdown): forward the react-markdown options it accepts#3105Lisa18289 wants to merge 2 commits into
Lisa18289 wants to merge 2 commits into
Conversation
Contributor
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
Lisa18289
enabled auto-merge (squash)
September 3, 2026 05:20
Lisa18289
force-pushed
the
fix/markdown-forward-react-markdown-options
branch
from
September 3, 2026 11:12
2cbdc83 to
024d187
Compare
MarkdownProps extends Omit<Options, "components">, so it type-checks
every react-markdown option, but only remarkPlugins and urlTransform
were passed on. The rest landed in ...rest and were spread onto the
wrapper div, where they did nothing except make React warn about an
unknown attribute — disallowedElements={["img"]} still rendered images.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Lisa18289
force-pushed
the
fix/markdown-forward-react-markdown-options
branch
from
September 3, 2026 11:15
024d187 to
42b2aa7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
MarkdownPropsextendsOmit<Options, "components">, soMarkdowntype-checksevery react-markdown option. Only
remarkPluginsandurlTransformwereactually passed on, though — everything else fell into
...restand got spreadonto the wrapper
div, where it did nothing except make React warn about anunknown attribute.
<Markdown disallowedElements={["img"]}>still renderedimages, silently.
This forwards the remaining options (
allowElement,allowedElements,disallowedElements,rehypePlugins,remarkRehypeOptions,skipHtml,unwrapDisallowed) toReactMarkdowninstead, so the props already in thepublic type do what they say. No API change, so no generated code changed.
Checklist
pnpm lintis clean andpnpm affected:testpasses (browser tests ifbehavior changed)
git diffis empty after the relevantbuild:*targets)de-DEanden-USlocale files —n/a, no strings
updated snapshots / the
update-screenshotslabel — n/a, no API or visualchange