summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-02-23 08:38:51 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-02-23 09:36:14 +0100
commitae48507d66db1fbe9b8fd5e3589941bee362a7ec (patch)
treedab66dabdef34b49834011dd2541d277f65fbf16 /hugolib/shortcode.go
parent7d78a498e19c2331a325fa43dd46f4da2b0443a6 (diff)
Fix shortcode error when closing without .Inner
Fixes #10672
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index d3430cb81..13fe913a6 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -564,10 +564,6 @@ func (s *shortcodeHandler) extractShortcode(ordinal, level int, source []byte, p
closed := false
const errorPrefix = "failed to extract shortcode"
- fail := func(err error, i pageparser.Item) error {
- return s.parseError(fmt.Errorf("%s: %w", errorPrefix, err), source, i.Pos())
- }
-
Loop:
for {
currItem := pt.Next()
@@ -607,10 +603,6 @@ Loop:
// we trust the template on this:
// if there's no inner, we're done
if !sc.isInline {
- if sc.info == nil {
- // This should not happen.
- return sc, fail(errors.New("BUG: template info not set"), currItem)
- }
if !sc.info.ParseInfo().IsInner {
return sc, nil
}
@@ -625,7 +617,7 @@ Loop:
// return that error, more specific
continue
}
- return sc, fail(fmt.Errorf("shortcode %q has no .Inner, yet a closing tag was provided", next.ValStr(source)), next)
+ return nil, fmt.Errorf("%s: shortcode %q does not evaluate .Inner or .InnerDeindent, yet a closing tag was provided", errorPrefix, next.ValStr(source))
}
}
if next.IsRightShortcodeDelim() {