summaryrefslogtreecommitdiff
path: root/www/src/components/Shell.astro
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-11-19 11:23:09 -0800
committerGravatar GitHub <noreply@github.com> 2021-11-19 11:23:09 -0800
commit1acedb5ce82edddc9c6d9a39717499d30cd82f49 (patch)
tree7983e20f41eb07b391584134f2056b0c34c03748 /www/src/components/Shell.astro
parent3f76849a0bd49c2446643cf2f6748c75625f12a6 (diff)
downloadastro-1acedb5ce82edddc9c6d9a39717499d30cd82f49.tar.gz
astro-1acedb5ce82edddc9c6d9a39717499d30cd82f49.tar.zst
astro-1acedb5ce82edddc9c6d9a39717499d30cd82f49.zip
Improve www blog page layout (#1898)
* wip * Update Shell.astro to not introduce additional newlines * fix recursive markdown in Note Co-authored-by: Jonathan Neal <jonathantneal@hotmail.com>
Diffstat (limited to 'www/src/components/Shell.astro')
-rw-r--r--www/src/components/Shell.astro9
1 files changed, 5 insertions, 4 deletions
diff --git a/www/src/components/Shell.astro b/www/src/components/Shell.astro
index d2738329a..3147ba886 100644
--- a/www/src/components/Shell.astro
+++ b/www/src/components/Shell.astro
@@ -4,10 +4,11 @@ export interface Props {
}
const { code } = Astro.props;
---
-
-<pre><code>{code.trim().split('\n').map(ln => <span class="line">
-{ln.startsWith('#') ? <span class="comment">{ln}</span> : ln}
-</span>)}</code></pre>
+<pre><code>{String(code).trim().split('\n').map(
+ line => <span class="line">{
+ line.startsWith('#') ? <span class="comment">{line}</span> : line
+ }</span>)
+}</code></pre>
<style>
pre, code {