Add a 'nonce' attribute to inline stylesheets#672
Add a 'nonce' attribute to inline stylesheets#672christianp wants to merge 1 commit intomathjax:developfrom
Conversation
The output options now has a property 'nonce', which is a string to use as the value for a 'nonce' attribute on <style> tags created by the output jax. If it's not given, no 'nonce' attribute is added. fixes #2665
|
The context menu also creates stylesheets, but it uses its own methods rather than the ones in OutputJax. I'm prepared to make the same changes to the mj-context-menu package, but where is the right place to pass it the nonce value? Is it possible to access the top-level options object from within the output jax and the context menu's constructors? |
|
I don't think you will be able to get the menu to work, as there are lots of dynamically changing styles, from the position of the menu initially, to the placement of submenus, and other things that are not mediated by classes. The creation of stylesheets is done here: but this is inside a I think you may have to go without the menu. |
|
The unorthodox use of namespaces are an artefact of the lack of string |
b77df61 to
1f851dd
Compare
The output options now has a property 'nonce', which is a string to use as the value for a 'nonce' attribute on <style> tags created by the output jax. If it's not given, no 'nonce' attribute is added.
This fixes mathjax/MathJax#2665
Here's a tiny page to test:
The
style.MJX-CHTML-stylestag has an attributenonce="hello".