FIX: allows polls to work with discourse-math (#110)

This commit is contained in:
Joffrey JAFFEUX 2025-06-23 09:41:06 +02:00 committed by GitHub
parent b1cc1481c9
commit e7ef2ec223
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
import { later } from "@ember/runloop";
import { later, next } from "@ember/runloop";
import { getURLWithCDN } from "discourse/lib/get-url";
import loadScript from "discourse/lib/load-script";
import { withPluginApi } from "discourse/lib/plugin-api";
@ -112,7 +112,9 @@ function mathjax(elem, opts) {
function initializeMath(api, discourseMathOptions) {
api.decorateCookedElement(
(element) => {
mathjax(element, discourseMathOptions);
next(() => {
mathjax(element, discourseMathOptions);
});
},
{ id: "mathjax" }
);