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
Fix duplication caused by highlighting
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -118,6 +118,9 @@ export default class TextualBody extends React.Component {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this._unmounted) return;
|
if (this._unmounted) return;
|
||||||
for (let i = 0; i < codes.length; i++) {
|
for (let i = 0; i < codes.length; i++) {
|
||||||
|
// If the code already has the hljs class we want to skip this.
|
||||||
|
// This happens after the codeblock was edited.
|
||||||
|
if (codes[i].className.includes("hljs")) continue;
|
||||||
this._highlightCode(codes[i]);
|
this._highlightCode(codes[i]);
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user