Highlight your CSP policy

Posted on 19 February 2016 in misc

It is common scenario when you need to show Content Security Policy example to the developers. If you use Highlight.js (syntax highlighter written in JavaScript) then from the next release it will be also possible to highlight CSP policy syntax. Like this one:

Content-Security-Policy:
    default-src 'self';
    style-src 'self' css.example.com;
    img-src *.example.com;
    script-src 'unsafe-eval' 'self' js.example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3'

csp