From 7d607654db8688b50ce4e6d30682694a8170fb43 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 10 Nov 2023 16:47:22 +0700 Subject: [PATCH] fix: preformatted text indents the first line strangely --- web/styles/components/code-block.scss | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/styles/components/code-block.scss b/web/styles/components/code-block.scss index c30911f32..2c31c5f3d 100644 --- a/web/styles/components/code-block.scss +++ b/web/styles/components/code-block.scss @@ -53,15 +53,23 @@ } .hljs { - overflow-x: auto; + overflow: auto; + display: block; + width: auto; background: #2b2b2b; color: #f8f8f2; padding: 0.5em; font-size: 14px; + word-wrap: normal; border-radius: 0.4rem; margin-top: 1rem; margin-bottom: 1rem; } +pre > code { + display: block; + text-indent: 0; + white-space: inherit; +} .hljs-emphasis { font-style: italic;