diff --git a/assets/css/system/module/_shortcodes.scss b/assets/css/system/module/_shortcodes.scss index 728f9b3..72d4b6a 100644 --- a/assets/css/system/module/_shortcodes.scss +++ b/assets/css/system/module/_shortcodes.scss @@ -54,7 +54,7 @@ body { border-radius: unset; code { - &:after { + .line:last-child:after { content: ' _'; opacity: 0; animation: cursor 1s infinite; @@ -82,16 +82,20 @@ body { &-linux { pre { - code:before { - content: 'user@host ~ % '; + code { + .line:first-child:before { + content: 'user@host ~ % '; + } } } &-root { pre { - code:before { - content: 'root@host ~ # '; - color: var(--bs-danger); + code { + .line:first-child:before { + content: 'root@host ~ # '; + color: var(--bs-danger); + } } } } @@ -99,16 +103,20 @@ body { &-windows { pre { - code:before { - content: 'C:\\Users\\User> '; + code { + .line:first-child:before { + content: 'C:\\Users\\User> '; + } } } &-root { pre { - code:before { - content: 'C:\\Users\\Admin> '; - color: var(--bs-danger); + code { + .line:first-child:before { + content: 'C:\\Users\\Admin> '; + color: var(--bs-danger); + } } } } diff --git a/layouts/_default/_markup/render-codeblock-terminal.html b/layouts/_default/_markup/render-codeblock-terminal.html index 2ced8b1..9543c2a 100644 --- a/layouts/_default/_markup/render-codeblock-terminal.html +++ b/layouts/_default/_markup/render-codeblock-terminal.html @@ -59,6 +59,13 @@
{{ (i18n "terminal") }}
-
{{ (highlight (($inner) | chomp) ($type)) }}
+ {{ $lang := "" }} + {{ if (eq ($attr.hl) "false") }} + {{ $lang = "plaintext" }} + {{ else }} + {{ if (eq ($attr.os) "windows") }}{{ $lang = "powershell" }}{{ end }} + {{ if (eq ($attr.os) "linux") }}{{ $lang = "bash" }}{{ end }} + {{ end }} +
{{ (highlight (($inner) | chomp) ($lang)) }}