Use length instead of the first element
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
c9baff1e10
commit
ce1be7a4cd
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue