syntax-highlighting.py: add nonce-source to CSP support

This commit is contained in:
Jesús 2021-11-02 15:17:34 -05:00
parent d05ebe3b64
commit 6535be64b9
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -49,7 +49,7 @@ except TypeError:
# highlight! :-) # highlight! :-)
# printout pygments' css definitions as well # printout pygments' css definitions as well
sys.stdout.write('<style>') sys.stdout.write('<style nonce="8909ab9">')
sys.stdout.write(formatter.get_style_defs('.highlight')) sys.stdout.write(formatter.get_style_defs('.highlight'))
sys.stdout.write('</style>') sys.stdout.write('</style>')
sys.stdout.write(highlight(data, lexer, formatter, outfile=None)) sys.stdout.write(highlight(data, lexer, formatter, outfile=None))