diff --git a/assets/css/template-styles.css b/assets/css/template-styles.css index a4bb338..9ce3042 100644 --- a/assets/css/template-styles.css +++ b/assets/css/template-styles.css @@ -161,7 +161,7 @@ code { } .cmd code { color: #fefefe; - white-space: nowrap; + white-space: pre-wrap; } .cmd code::before { content: '$'; diff --git a/exampleSite/content/post/cmd-test.md b/exampleSite/content/post/cmd-test.md new file mode 100644 index 0000000..55c1569 --- /dev/null +++ b/exampleSite/content/post/cmd-test.md @@ -0,0 +1,13 @@ +--- +title: "cmd Test" +date: 2020-08-04T21:05:05-05:00 +tags: [issue] +--- + +Testing out GitHub issue https://github.com/zwbetz-gh/cupper-hugo-theme/issues/42 + +{{< cmd >}} +Line 1 +Line 2 +Line 3 +{{}} diff --git a/layouts/shortcodes/cmd.html b/layouts/shortcodes/cmd.html index cd21bc1..ccadc07 100644 --- a/layouts/shortcodes/cmd.html +++ b/layouts/shortcodes/cmd.html @@ -1 +1,7 @@ -
{{ trim .Inner "\n" }}
+{{ $trimmed := (trim .Inner "\n") }} +{{ $lines := split $trimmed "\n" }} +
+  {{ range $lines }}
+  {{ . }}
+  {{ end }}
+