1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-05 23:10:41 +03:00

Fix duplication caused by highlighting

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-02-10 14:20:19 +01:00
parent 895be6e7a6
commit 6b0b46b917

View File

@@ -118,6 +118,9 @@ export default class TextualBody extends React.Component {
setTimeout(() => {
if (this._unmounted) return;
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]);
}
}, 10);