Skip to content

Fiddle: stop rendering raw html in markdown#243

Merged
krishan711 merged 1 commit into
mainfrom
fixhtml
Jan 26, 2026
Merged

Fiddle: stop rendering raw html in markdown#243
krishan711 merged 1 commit into
mainfrom
fixhtml

Conversation

@krishan711
Copy link
Copy Markdown
Contributor

Description

Screenshots:

Checklist:

  • I have updated the CHANGELOG with a summary of my changes
  • I have updated the documentation accordingly

Copilot AI review requested due to automatic review settings January 26, 2026 17:02
@krishan711 krishan711 merged commit 73a7b34 into main Jan 26, 2026
8 checks passed
@krishan711 krishan711 deleted the fixhtml branch January 26, 2026 17:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the markdown rendering components to stop parsing raw HTML by default while allowing explicit opt-in for HTML parsing on the main Markdown component, and documents the new behavior in the changelog.

Changes:

  • Add disableParsingRawHTML to MarkdownText so inline markdown never parses raw HTML.
  • Add a new shouldEnableHtmlParsing prop to Markdown and wire it to markdown-to-jsx’s disableParsingRawHTML option (HTML disabled by default).
  • Update the changelog to record the new Markdown prop and behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/molecules/markdownText/component.tsx Forces MarkdownText to disable raw HTML parsing, but currently conflicts with its newline handling strategy.
src/molecules/markdown/component.tsx Introduces shouldEnableHtmlParsing and disables raw HTML parsing by default in the core Markdown renderer.
CHANGELOG.md Documents the addition of shouldEnableHtmlParsing on Markdown under the Unreleased/Changed section.

Comment on lines 41 to 45
<MarkdownToJsx
options={{
forceWrapper: true,
disableParsingRawHTML: true,
wrapper: React.Fragment,
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

Setting disableParsingRawHTML: true here breaks the existing newline handling logic, since content is built using literal <br/> tags (see the source.replace call above) and markdown-to-jsx will now render those as plain text rather than line breaks. To preserve the current visual behavior while disabling raw HTML, the newline transformation should be updated to avoid injecting <br/> (e.g. rely only on markdown line-break syntax or another non-HTML approach) so that the WithNewlines story and other multiline content do not show raw <br/> characters in the UI.

Copilot uses AI. Check for mistakes.
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.

2 participants