Skip to content

Commit

Permalink
Correctly get nonce when spawning style nodes.
Browse files Browse the repository at this point in the history
Get nonce at render, rather than using JS
Sorry the diff is unreadable, ctrl+f for "window.MathJax.config.chtml.nonce" and that's the change
  • Loading branch information
sneakers-the-rat committed Feb 2, 2024
1 parent e42e418 commit 9364a02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@

%script{ nonce: request.content_security_policy_nonce }
:plain
var nonce = document.querySelector('meta[name="style-nonce"]').getAttribute('content');
window.MathJax = {
chtml: {nonce: nonce},
chtml: {nonce: "#{request.content_security_policy_nonce}" },
tex: {
processEnvironments: false,
processRefs: false,
Expand Down
2 changes: 1 addition & 1 deletion public/MathJax/es5/tex-chtml.js

Large diffs are not rendered by default.

0 comments on commit 9364a02

Please sign in to comment.