You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Run highlight.js asynchronously
Move the very minimal logic of highlightDOM into TextualBody because then we can avoid scheduling a lot of timeouts which would ultimately do nothing (ie. any messages that don't have code blocks).
This commit is contained in:
@@ -302,13 +302,6 @@ export function bodyToHtml(content, highlights, opts) {
|
||||
return <span className={className} dangerouslySetInnerHTML={{ __html: safeBody }} />;
|
||||
}
|
||||
|
||||
export function highlightDom(element) {
|
||||
var blocks = element.getElementsByTagName("code");
|
||||
for (var i = 0; i < blocks.length; i++) {
|
||||
highlight.highlightBlock(blocks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
export function emojifyText(text) {
|
||||
return {
|
||||
__html: unicodeToImage(escape(text)),
|
||||
|
||||
Reference in New Issue
Block a user