From 9fcd6f2e8343d79d62e6cca18447672813d46647 Mon Sep 17 00:00:00 2001 From: Caleb Frey Date: Tue, 13 Jul 2021 17:36:00 -0400 Subject: [PATCH] Make prismjs shortcode CRLF tolerant Checks for extra line in the form of `\r\n` or `\n` so that it's recognized and removed appropriately when edited in a CRLF editor --- layouts/shortcodes/prismjs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/prismjs.html b/layouts/shortcodes/prismjs.html index fe73753..e4acffe 100644 --- a/layouts/shortcodes/prismjs.html +++ b/layouts/shortcodes/prismjs.html @@ -1,4 +1,4 @@ -{{ $inner := replaceRE "^\n" "" .Inner | string }} +{{ $inner := replaceRE "^\r?\n" "" .Inner | string }} {{ if len .Params | eq 0 }}
{{ $inner }}
{{ else }}