@@ -393,6 +393,61 @@ Link: [Foo](/foo)
393393 }
394394}
395395
396+ func TestCodeblockIssue13864 (t * testing.T ) {
397+ t .Parallel ()
398+
399+ files := `
400+ -- hugo.toml --
401+ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
402+ -- content/_index.md --
403+ ---
404+ title: home
405+ ---
406+
407+ ~~~
408+ LANG: none
409+ ~~~
410+
411+ ~~~go
412+ LANG: go
413+ ~~~
414+
415+ ~~~go-html-template
416+ LANG: go-html-template
417+ ~~~
418+
419+ ~~~xy
420+ LANG: xy
421+ ~~~
422+
423+ ~~~x-y
424+ LANG: x-y
425+ ~~~
426+ -- layouts/home.html --
427+ {{ .Content }}
428+ -- layouts/_markup/render-codeblock.html --
429+ {{ .Inner }} LAYOUT: render-codeblock.html|
430+ -- layouts/_markup/render-codeblock-go.html --
431+ {{ .Inner }} LAYOUT: render-codeblock-go.html|
432+ -- layouts/_markup/render-codeblock-go-html-template.html --
433+ {{ .Inner }} LAYOUT: render-codeblock-go-html-template.html|
434+ -- layouts/_markup/render-codeblock-xy.html --
435+ {{ .Inner }} LAYOUT: render-codeblock-xy.html|
436+ -- layouts/_markup/render-codeblock-x-y.html.html --
437+ {{ .Inner }} LAYOUT: render-codeblock-x-y.html|
438+ `
439+
440+ b := hugolib .Test (t , files )
441+
442+ b .AssertFileContent ("public/index.html" ,
443+ "LANG: none LAYOUT: render-codeblock.html|" , // pass
444+ "LANG: go LAYOUT: render-codeblock-go.html|" , // fail: uses render-codeblock-go-html-template.html
445+ "LANG: go-html-template LAYOUT: render-codeblock-go-html-template.html|" , // fail: uses render-codeblock.html
446+ "LANG: xy LAYOUT: render-codeblock-xy.html|" , // pass
447+ "LANG: x-y LAYOUT: render-codeblock-x-y.html|" , // fail: uses render-codeblock.html
448+ )
449+ }
450+
396451func TestRenderCodeblockSpecificity (t * testing.T ) {
397452 files := `
398453-- hugo.toml --
0 commit comments