diff --git a/app/assets/javascripts/discourse/helpers/custom-html.js.es6 b/app/assets/javascripts/discourse/helpers/custom-html.js.es6 index 5c77dbaf49f..5a389ea49c2 100644 --- a/app/assets/javascripts/discourse/helpers/custom-html.js.es6 +++ b/app/assets/javascripts/discourse/helpers/custom-html.js.es6 @@ -20,7 +20,15 @@ export function setCustomHTML(key, html) { _customizations[key] = html; } -registerHelper('custom-html', function([id]) { +registerHelper('custom-html', function([id, contextString], hash, options, env) { const html = getCustomHTML(id); if (html) { return html; } + + if (env) { + const target = (env || contextString); + const container = target.container || target.data.view.container; + if (container.lookup('template:' + id)) { + return env.helpers.partial.helperFunction.apply(this, arguments); + } + } });