elbywan/yett

Mathjax not working with yett

aquint-zama opened this issue · 2 comments

First of all thank you for this useful library!

I stumble upon an issue trying to use yett (for managing Google Analytics) in a page using Mathjax.

Mathjax seems to patch the current document to inject scripts elements for math display but this seems to be blocked by yett.

here is a small POC:

<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>MathJax / Yett</title>
        <!-- MathJax -->
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
        <script>
        window.YETT_BLACKLIST = [
            /googletagmanager\.com/,
            ];
        </script>
        <!-- <script src="https://unpkg.com/yett"></script> -->
    </head>
    <body>
        <h1>MathJax & Yett test</h1>
        <p>$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$</p>
    </body>
</html>

uncommenting yett loading will break the Mathjax rendering.

Hey @aquint-zama @immortal-tofu,

First of all thank you for this useful library!

Thank you for using it! ❤️

Mathjax seems to patch the current document to inject scripts elements for math display but this seems to be blocked by yett.

I just pushed v0.2.2 including a fix that should solve the problem.

For the record, yett was overriding the HTMLScriptElement.prototype src/type fields defined properties but it should be all good now.

It works perfectly well, thanks a lot for the quick update 👍