Repository navigation
Fix dcc.Markdown blanking emoji character references - #4194
Conversation
Dash performance benchmarks
growth = late-third / early-third per-op time; ~1 is flat, a large value means the per-op cost scales with accumulated state. machine scale vs baseline: 0.69x - divided out of the baseline ratios so they compare like for like (the absolute warn/fail ceilings are left un-scaled); calibrated on |
camdecoster
left a comment
There was a problem hiding this comment.
Looks good. I only have one non-blocking comment.
| "react-fast-compare": "^3.2.2", | ||
| "react-input-autosize": "^3.0.0", | ||
| "react-markdown": "^8.0.7", | ||
| "react-markdown": "^9.1.0", |
There was a problem hiding this comment.
Since you're already doing a major upgrade, could you go ahead and upgrade to v10?
There was a problem hiding this comment.
Done in f18f32b: v10 only removed the className prop, which we don't pass, so it is a drop-in. The markdown integration tests pass.
…tities # Conflicts: # CHANGELOG.md
…tities # Conflicts: # CHANGELOG.md
|



Since 4.5.0,
dcc.Markdownrenders numeric character references above U+FFFF as blank, so😀shows nothing where it used to show an emoji. The parser that react-markdown 8 pulls in mishandles them. This moves dcc to react-markdown 9 (with remark-gfm 4, remark-math 6, rehype-raw 7, unist-util-visit 5), whose parser handles them.v9 dropped a few things we relied on, so they come back as small plugins:
rehypeLinkTarget.tsreplaces the removedlinkTargetoption. As before,link_targetapplies to every link, raw HTML ones included.rehypeBlockCode.tsreplaces the removedinlineflag, so only code inside<pre>gets highlighted.<pre><code>, sorehypeDashMath.tsunwraps it.tel:. A customurlTransformkeeps it, as v8 did.Object.hasOwnandArray.prototype.at, which are newer than our browserslist and are not caught by es-check.polyfills.tsadds them only when missing, and only loads with the Markdown chunk.entities,vfile-locationandstyle-to-objectare added to the Babel include list so the bundle still passes the ES2018 check. Prettier also reformattedwebpack.config.jsbecause the pre-commit hook checks the whole file. The only real change is that include line.Other differences:
javascript:URLs are still neutralized. v8 rewrote them tojavascript:void(0), v9 empties them, and it now does so for every URL attribute in raw HTML (src,actionand so on), not only links and images.Tests
mkdw019tomkdw024cover emoji entities (Markdown and raw HTML), code highlighting, display math,link_targeton raw links,tel:, and rendering with the two builtins deleted. Each one fails without its fix.Note: #4130 also touches
Markdown.tsxand the math path, so whichever lands second will need a rebase.