Skip to content

fix(Markdown): forward the react-markdown options it accepts - #3105

Open
Lisa18289 wants to merge 2 commits into
mainfrom
fix/markdown-forward-react-markdown-options
Open

fix(Markdown): forward the react-markdown options it accepts#3105
Lisa18289 wants to merge 2 commits into
mainfrom
fix/markdown-forward-react-markdown-options

Conversation

@Lisa18289

@Lisa18289 Lisa18289 commented Sep 2, 2026

Copy link
Copy Markdown
Member

What & why

MarkdownProps extends Omit<Options, "components">, so Markdown type-checks
every react-markdown option. Only remarkPlugins and urlTransform were
actually passed on, though — everything else fell into ...rest and got spread
onto the wrapper div, where it did nothing except make React warn about an
unknown attribute. <Markdown disallowedElements={["img"]}> still rendered
images, silently.

This forwards the remaining options (allowElement, allowedElements,
disallowedElements, rehypePlugins, remarkRehypeOptions, skipHtml,
unwrapDisallowed) to ReactMarkdown instead, so the props already in the
public type do what they say. No API change, so no generated code changed.

Checklist

  • PR title is a Conventional Commit and matches the base branch above
  • pnpm lint is clean and pnpm affected:test passes (browser tests if
    behavior changed)
  • Generated code is committed (git diff is empty after the relevant
    build:* targets)
  • User-facing strings added to both de-DE and en-US locale files —
    n/a, no strings
  • Docs updated if a public API changed; intentional visual changes get
    updated snapshots / the update-screenshots label — n/a, no API or visual
    change

@Lisa18289
Lisa18289 requested a review from a team September 2, 2026 13:53
@Lisa18289 Lisa18289 self-assigned this Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6655 for commit 42b2aa7 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3105.docs.review.flow-components.de
storybook pr-3105.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3105
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3105

@Lisa18289
Lisa18289 enabled auto-merge (squash) September 3, 2026 05:20
@Lisa18289
Lisa18289 force-pushed the fix/markdown-forward-react-markdown-options branch from 2cbdc83 to 024d187 Compare September 3, 2026 11:12
Lisa18289 and others added 2 commits September 3, 2026 13:15
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
Lisa18289 force-pushed the fix/markdown-forward-react-markdown-options branch from 024d187 to 42b2aa7 Compare September 3, 2026 11:15
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