We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a261a62 commit c5dfe3eCopy full SHA for c5dfe3e
1 file changed
app/assets/javascripts/codeblocks.js
@@ -1,12 +1,12 @@
1
-$(() => {
+document.addEventListener('DOMContentLoaded', () => {
2
const buttonTemplate = `<button class="copy-button button is-muted is-outlined has-margin-2">Copy</button>`;
3
4
$('.post--content pre > code')
5
.parent()
6
.each(function () {
7
const $button = $(buttonTemplate);
8
const $content = $(this).text();
9
- const numLines = $content.trim().split(/\r?\n/).length
+ const numLines = $content.trim().split(/\r?\n/).length;
10
11
if (numLines <= 1) {
12
$button.addClass('is-small');
0 commit comments