diff --git a/layouts/shortcodes/paige/code.html b/layouts/shortcodes/paige/code.html
index f9533826..d85acb3f 100644
--- a/layouts/shortcodes/paige/code.html
+++ b/layouts/shortcodes/paige/code.html
@@ -1,4 +1,4 @@
-{{ $content := .InnerDeindent | replaceRE "^\n" "" }}
+{{ $content := trim .InnerDeindent "\f\n\r\v" }}
{{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }}
{{ $options := .Get "options" }}
diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html
index 83f1d4a1..eafa5a78 100644
--- a/layouts/shortcodes/paige/quote.html
+++ b/layouts/shortcodes/paige/quote.html
@@ -1,5 +1,5 @@
{{ $cite := .Get 0 | default (.Get "cite") }}
-{{ $content := .InnerDeindent | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }}
+{{ $content := trim .InnerDeindent "\f\n\r\v" | markdownify }}
{{ if not $content }}
{{ errorf "layouts/shortcodes/paige/quote.html: no content" }}