Skip to content

Markdown apostrophe (``) use to highlight a keyword not working #32416

Closed

Description

@pankajsoni22

Bug description

The but is that

  1. Go to a dashboard
  2. Add a markdown
  3. 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

Image

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.

Activity

  1. dosubot commented on Feb 27, 2025

    @dosubot

    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].

    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

  2. hainenber commented on Feb 28, 2025

    @hainenber
    Contributor

    Pin remark-gfm back to v3 solves the described issue.

    Screen.Recording.2025-02-28.at.12.24.40.mov
  3. rusackas commented on Feb 28, 2025

    @rusackas
    Member

    I wonder if remark has a fix for this in a newer version?

  4. hainenber commented on Mar 1, 2025

    @hainenber
    Contributor

    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.

  5. moved this from New to Done in Apache Superset 5.0.0on Mar 3, 2025
  6. moved this from Done to Cherried in Apache Superset 5.0.0on Apr 1, 2025
  7. sfirke commented on May 16, 2025

    @sfirke
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

dashboard:markdownRelated to the markdown component of the Dashboard

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions