Fix it so e.g. de in layouts/_shortcodes/de.html is not interpreted as a language code

Fixes #13740
This commit is contained in:
Bjørn Erik Pedersen
2025-05-26 10:22:13 +02:00
parent f47193669d
commit 9ad26b69ad
3 changed files with 18 additions and 8 deletions

View File

@@ -563,11 +563,20 @@ func TestParseLayouts(t *testing.T) {
c.Assert(p.Type(), qt.Equals, TypePartial)
},
},
{
"Shortcode lang in root",
"/_shortcodes/no.html",
func(c *qt.C, p *Path) {
c.Assert(p.Type(), qt.Equals, TypeShortcode)
c.Assert(p.Lang(), qt.Equals, "")
c.Assert(p.NameNoIdentifier(), qt.Equals, "no")
},
},
}
for _, test := range tests {
c.Run(test.name, func(c *qt.C) {
if test.name != "Baseof" {
if test.name != "Shortcode lang in root" {
// return
}
test.assert(c, testParser.Parse(files.ComponentFolderLayouts, test.path))