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
Use length instead of the first element
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -100,7 +100,7 @@ export default class TextualBody extends React.Component {
|
|||||||
// This happens after the codeblock was edited.
|
// This happens after the codeblock was edited.
|
||||||
if (pres[i].parentNode.className == "mx_EventTile_pre_container") continue;
|
if (pres[i].parentNode.className == "mx_EventTile_pre_container") continue;
|
||||||
// Add code element if it's missing
|
// Add code element if it's missing
|
||||||
if (!pres[i].getElementsByTagName("code")[0]) {
|
if (pres[i].getElementsByTagName("code").length == 0) {
|
||||||
this._addCodeElement(pres[i]);
|
this._addCodeElement(pres[i]);
|
||||||
}
|
}
|
||||||
// Wrap a div around <pre> so that the copy button can be correctly positioned
|
// Wrap a div around <pre> so that the copy button can be correctly positioned
|
||||||
|
|||||||
Reference in New Issue
Block a user