mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Improve error message for unclosed shortcode with inner content
This commit is contained in:
committed by
GitHub
parent
34a86e13f6
commit
9818724b5b
@@ -689,7 +689,7 @@ Loop:
|
|||||||
case currItem.IsDone():
|
case currItem.IsDone():
|
||||||
if !currItem.IsError() {
|
if !currItem.IsError() {
|
||||||
if !closed && sc.needsInner() {
|
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
|
// handled by caller
|
||||||
|
@@ -1274,5 +1274,5 @@ Inner: {{ .Get 0 }}: {{ len .Inner }}
|
|||||||
).BuildE()
|
).BuildE()
|
||||||
|
|
||||||
b.Assert(err, qt.Not(qt.IsNil))
|
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`)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user