You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Markdown apostrophe (``) use to highlight a keyword not working #32416
Edit the markdown and add any string enclosed between `` i.e. string, which should highlight the "string" word but this is throwing "This markdown component has an error."
Version Superset: 5.0.0rc1
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
I have searched Superset docs and Slack and didn't find a solution to my problem.
I have searched the GitHub issue tracker and didn't find a similar bug report.
I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
The error message "This markdown component has an error" is triggered in the Markdown.jsx file when there is an issue with rendering the markdown content. This error handling is implemented in the componentDidCatch method, which displays the error message if the markdown component encounters an error during rendering [1].
In Superset version 5.0.0rc1, there have been recent changes to the markdown rendering logic, including the addition of a remark plugin and improvements to the SafeMarkdown HTML sanitization [2][3]. The SafeMarkdown component, which handles markdown rendering, uses the react-markdown library and supports GitHub Flavored Markdown (GFM) through the remark-gfm plugin. It also includes HTML sanitization, which can be customized [4].
The issue with using backticks (``) to highlight a keyword might be related to these recent changes or the configuration of the SafeMarkdown component. You might want to check if the `EscapeMarkdownHtml` feature flag is enabled, as it affects how HTML is handled in markdown [4].
According to this post, it's a yes but require react-markdown to next major version, which is something we can't do due to the upgrade requires React 18.
Just deleted an incorrect comment saying I was seeing this in 4.1.2 when I should have said 5.0.0rc2 -- which doesn't add anything to this thread, sorry.
Activity
dosubot commentedon Feb 27, 2025
The error message "This markdown component has an error" is triggered in the
Markdown.jsxfile when there is an issue with rendering the markdown content. This error handling is implemented in thecomponentDidCatchmethod, which displays the error message if the markdown component encounters an error during rendering [1].In Superset version 5.0.0rc1, there have been recent changes to the markdown rendering logic, including the addition of a remark plugin and improvements to the
SafeMarkdownHTML sanitization [2][3]. TheSafeMarkdowncomponent, which handles markdown rendering, uses thereact-markdownlibrary and supports GitHub Flavored Markdown (GFM) through theremark-gfmplugin. It also includes HTML sanitization, which can be customized [4].The issue with using backticks (``) to highlight a keyword might be related to these recent changes or the configuration of the
SafeMarkdowncomponent. You might want to check if the `EscapeMarkdownHtml` feature flag is enabled, as it affects how HTML is handled in markdown [4].To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
hainenber commentedon Feb 28, 2025
Pin
remark-gfmback to v3 solves the described issue.Screen.Recording.2025-02-28.at.12.24.40.mov
rusackas commentedon Feb 28, 2025
I wonder if remark has a fix for this in a newer version?
hainenber commentedon Mar 1, 2025
According to this post, it's a yes but require
react-markdownto next major version, which is something we can't do due to the upgrade requires React 18.sfirke commentedon May 16, 2025
Just deleted an incorrect comment saying I was seeing this in 4.1.2 when I should have said 5.0.0rc2 -- which doesn't add anything to this thread, sorry.
test: add comprehensive remark-gfm v3 compatibility regression tests
test: add comprehensive remark-gfm v3 compatibility regression tests
test: add comprehensive remark-gfm v3 compatibility regression tests
test: add comprehensive remark-gfm v3 compatibility regression tests