From c5f7baa9b0ff59650ca2e55ac6b2e901a76c4e19 Mon Sep 17 00:00:00 2001 From: artalar Date: Mon, 24 Jul 2023 07:30:14 +0300 Subject: [PATCH] docs: fix logs separator in repl --- docs/src/components/Repl.astro | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/src/components/Repl.astro b/docs/src/components/Repl.astro index b2c6923f4..fb9f8f10d 100644 --- a/docs/src/components/Repl.astro +++ b/docs/src/components/Repl.astro @@ -89,8 +89,9 @@ numberAtom(ctx, (s) => s + 1) button.innerText = '⌛' try { - const lastLogRecord = logsEl.children[logsEl.children.length - 1] - if (lastLogRecord instanceof HTMLHRElement == false) { + const { length } = logsEl.children + const lastLogRecord = logsEl.children[length - 1] + if (length && lastLogRecord instanceof HTMLHRElement == false) { const br = document.createElement('hr') logsEl.appendChild(br) } @@ -156,7 +157,9 @@ numberAtom(ctx, (s) => s + 1) :global(aside) { display: none; padding: 0.5rem; - max-height: calc(100vh - calc(var(--sl-nav-height) + var(--sl-mobile-toc-height))); + max-height: calc( + 100vh - calc(var(--sl-nav-height) + var(--sl-mobile-toc-height)) + ); overflow-y: scroll; }