Skip to content

Conversation

mokat6
Copy link
Contributor

@mokat6 mokat6 commented Jul 28, 2025

Bug: skipHTML prop was not doing anything. The bug persisted in both

  • @uiw/react-markdown-preview
  • @uiw/react-markdown-preview/nohighlight

The way it was:

rehypePlugins array holds the plugins. It adds rehypeRaw in index.tsx and nohighlight.tsx
Then in preview it checks

  if (skipHtml) {
    rehypePlugins.push(raw);
  }

If the skipHtml is true, then it adds it again. But it was already added in index / nohighlight

Solution for nohighlight

rehypeRaw is not added in nohighlight.tsx (deleted) it is added in preview based on skipHTML value.

Solution for index (with highlights)

Not fixed. I can't remove rehypeRaw in index.txt because

    [rehypePrism, { ignoreMissing: true }],

Requires rehypeRaw to exist there.


So not solved for with highlighting, but solved for nohighlight

@jaywcjlove jaywcjlove merged commit fc2a4fb into uiwjs:master Jul 28, 2025
1 check passed
github-actions bot added a commit that referenced this pull request Jul 28, 2025
jaywcjlove added a commit that referenced this pull request Jul 28, 2025
github-actions bot added a commit that referenced this pull request Jul 28, 2025
mokat6 pushed a commit to mokat6/react-markdown-preview that referenced this pull request Jul 28, 2025
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