question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot use span tag in markdown

See original GitHub issue

Describe your context Please provide us your environment so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash==1.3.1
dash-core-components==1.2.1
dash-html-components==1.0.1
dash-renderer==1.1.0
dash-table==4.3.0

Describe the bug

Html should be valid markdown, however I cannot use span tags to change the font color for example.

Here is an example:

dcc.Markdown(["foo <span style='color:red'>bar</span>"], dangerously_allow_html=True)

which is rendered like this

<p>foo <span><span style="color:red"></span></span>bar<span></span></p>

Expected behavior

“bar” should be enclosed in my defined span tag.

Edit: typo

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
codytodonnellcommented, Apr 22, 2021

Any movement on this? Can confirm that this problem still exists in dash 1.20

You cannot embed html inside dcc.Markdown if there are attributes on the html element.

1reaction
alexcjohnsoncommented, Oct 16, 2019

hmm OK, I have to say I’m stumped. Our package-lock was holding us at 4.0.6, but bumping to 4.2.2 didn’t change this behavior. So at this point I can put what looks like identical props (with the exception of one plugin and a special renderer for code blocks, that the demo uses) into react-markdown via dcc.Markdown and the live demo, and the results are different. Not sure where to go from here but I’m open to suggestions.

Regardless, thanks for bringing this up!

Read more comments on GitHub >

github_iconTop Results From Across the Web

styled <span> inside markdown table - html - Stack Overflow
In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and...
Read more >
Markdown Syntax Documentation - Daring Fireball
To indicate a span of code, wrap it with backtick quotes ( ` ). Unlike a pre-formatted code block, a code span indicates...
Read more >
Bug in formatting with markdown / span tags
When formatting the first word or line in a label cell with markdown or inline HTML (e.g. bold with asterisks or color with...
Read more >
Markdown support - Doxygen Manual
Note that you cannot start a code block in the middle of a paragraph (i.e. the ... To show a literal backtick or...
Read more >
Markdown Syntax | YouTrack Server Documentation - JetBrains
In YouTrack, you can format text using the Markdown markup syntax. ... You can't have more than three space characters in front of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found