dash
dash copied to clipboard
Rehighlights dcc.Markdown when it is updated
Fixes #2895.
The problem is that highlight.js was changed in https://github.com/highlightjs/highlight.js/commit/3987abe437dbf962d64a51da6282d9c9bc20fc13, which prevents re-highlighting an element.
The attribute data-highlighted="yes" flags an element as highlighted. Hence, the solution is to remove this attribute before the code is re-highlighted.
Contributor Checklist
- [x] I have broken down my PR scope into the following TODO tasks
- [x] Re-highlights
dcc.Markdownafter it is updated
- [x] Re-highlights
- [x] I have run the tests locally and they passed. (refer to testing section in contributing)
- [x] I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR
optionals
- [ ] I have added entry in the
CHANGELOG.md - [ ] If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
- [ ] this GitHub #PR number updates the dash docs
- [ ] here is the show and tell thread in Plotly Dash community
@T4rk1n can you please have a look and let us know if we can merge?