diff --git a/app/assets/javascripts/discourse/app/lib/render-tags.js b/app/assets/javascripts/discourse/app/lib/render-tags.js index d4aebe57edc..6f8aedf9e9f 100644 --- a/app/assets/javascripts/discourse/app/lib/render-tags.js +++ b/app/assets/javascripts/discourse/app/lib/render-tags.js @@ -17,6 +17,11 @@ export function addTagsHtmlCallback(callback, options) { callbacks.splice(i, 0, callback); } +export function clearTagsHtmlCallbacks() { + callbacks = null; + priorities = null; +} + export default function (topic, params) { let tags = topic.tags; let buffer = ""; diff --git a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js index a7b2cb44568..975e67078ed 100644 --- a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js +++ b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js @@ -69,6 +69,7 @@ import { clearTagDecorateCallbacks, clearTextDecorateCallbacks, } from "discourse/lib/to-markdown"; +import { clearTagsHtmlCallbacks } from "discourse/lib/render-tags"; import { clearToolbarCallbacks } from "discourse/components/d-editor"; export function currentUser() { @@ -194,6 +195,7 @@ export function testCleanup(container, app) { clearTextDecorateCallbacks(); clearResolverOptions(); clearLegacyResolverOptions(); + clearTagsHtmlCallbacks(); clearToolbarCallbacks(); }