mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Improve error message for unclosed shortcode with inner content
This commit is contained in:
parent
34a86e13f6
commit
9818724b5b
2 changed files with 2 additions and 2 deletions
|
@ -689,7 +689,7 @@ Loop:
|
|||
case currItem.IsDone():
|
||||
if !currItem.IsError() {
|
||||
if !closed && sc.needsInner() {
|
||||
return sc, fmt.Errorf("%s: unclosed shortcode %q", errorPrefix, sc.name)
|
||||
return sc, fmt.Errorf("%s: shortcode %q must be closed or self-closed", errorPrefix, sc.name)
|
||||
}
|
||||
}
|
||||
// handled by caller
|
||||
|
|
|
@ -1274,5 +1274,5 @@ Inner: {{ .Get 0 }}: {{ len .Inner }}
|
|||
).BuildE()
|
||||
|
||||
b.Assert(err, qt.Not(qt.IsNil))
|
||||
b.Assert(err.Error(), qt.Contains, `p1.md:5:1": failed to extract shortcode: unclosed shortcode "sc"`)
|
||||
b.Assert(err.Error(), qt.Contains, `p1.md:5:1": failed to extract shortcode: shortcode "sc" must be closed or self-closed`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue