Fail if no content for all shortcodes

This commit is contained in:
Will Faught
2023-03-04 11:23:56 -08:00
parent 22ce6fb1fc
commit 754926f6c0
7 changed files with 24 additions and 3 deletions

View File

@@ -1,4 +1,9 @@
{{ $content := .Inner | replaceRE "^\n" "" }}
{{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }}
{{ $options := .Get "options" }}
<div class="paige-code">{{ highlight (.Inner | replaceRE "^\n" "") $lang $options }}</div>
{{ if not $content }}
{{ errorf "paige/code: no content" }}
{{ end }}
<div class="paige-code">{{ highlight $content $lang $options }}</div>