Fix shortcode name in error message on self-closing shortcodes with no .Inner

Fixes #13344
This commit is contained in:
Bjørn Erik Pedersen
2025-02-04 11:18:26 +01:00
parent 377287a614
commit e865d59844
2 changed files with 28 additions and 8 deletions

View File

@@ -650,7 +650,11 @@ Loop:
// return that error, more specific
continue
}
return nil, fmt.Errorf("%s: shortcode %q does not evaluate .Inner or .InnerDeindent, yet a closing tag was provided", errorPrefix, next.ValStr(source))
name := sc.name
if name == "" {
name = next.ValStr(source)
}
return nil, fmt.Errorf("%s: shortcode %q does not evaluate .Inner or .InnerDeindent, yet a closing tag was provided", errorPrefix, name)
}
}
if next.IsRightShortcodeDelim() {