Fix duplication caused by highlighting
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
895be6e7a6
commit
6b0b46b917
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue