Use includes instead of indexOf

This commit is contained in:
Maximilian Krög
2022-08-05 00:36:16 +02:00
parent 5e34b9aa20
commit 0b945f2321
26 changed files with 50 additions and 57 deletions

View File

@@ -6,7 +6,7 @@
<p class="code-caption"><?js= example.caption ?></p>
<?js } ?>
<?js if (example.code.toString().indexOf('<pre>') === -1) { ?>
<?js if (!example.code.toString().includes('<pre>')) { ?>
<pre class="prettyprint"><code><?js= example.code ?></code></pre>
<?js } else { ?>
<?js= example.code.replace(/<pre>/g, '<pre class="prettyprint">') ?>