tpl: Fix it so embedded render-codeblock-goat is used even if custom render-codeblock exists

Fixes #13595
This commit is contained in:
Bjørn Erik Pedersen
2025-04-12 12:02:33 +02:00
parent 53221f88ca
commit c8710625b7
3 changed files with 100 additions and 7 deletions

View File

@@ -1832,7 +1832,10 @@ func (best *bestMatch) isBetter(w weight, ti *TemplInfo) bool {
return false
}
if best.w.w1 > 0 {
// Note that for render hook templates, we need to make
// the embedded render hook template wih if they're a better match,
// e.g. render-codeblock-goat.html.
if best.templ.category != CategoryMarkup && best.w.w1 > 0 {
currentBestIsEmbedded := best.templ.subCategory == SubCategoryEmbedded
if currentBestIsEmbedded {
if ti.subCategory != SubCategoryEmbedded {