diff --git a/bower.json b/bower.json index 16bc2d624eb..0b12ebee282 100644 --- a/bower.json +++ b/bower.json @@ -20,6 +20,7 @@ "bower_components/prism/components/prism-clike.js", "bower_components/prism/components/prism-javascript.js", "bower_components/prism/components/prism-json.js", + "bower_components/prism/components/prism-jsonp.js", "bower_components/prism/components/prism-css-extras.js", "bower_components/prism/components/prism-rust.js", "bower_components/prism/plugins/line-highlight/prism-line-highlight.js", diff --git a/kuma/settings/common.py b/kuma/settings/common.py index c1fa07b98c8..71249974c49 100644 --- a/kuma/settings/common.py +++ b/kuma/settings/common.py @@ -1051,6 +1051,7 @@ def pipeline_one_scss(slug, **kwargs): "js/libs/prism/prism-clike.js", "js/libs/prism/prism-javascript.js", "js/libs/prism/prism-json.js", + "js/libs/prism/prism-jsonp.js", "js/libs/prism/prism-css-extras.js", "js/libs/prism/prism-rust.js", "js/libs/prism/prism-line-highlight.js", diff --git a/kuma/static/js/libs/prism/prism-jsonp.js b/kuma/static/js/libs/prism/prism-jsonp.js new file mode 100644 index 00000000000..c942015776c --- /dev/null +++ b/kuma/static/js/libs/prism/prism-jsonp.js @@ -0,0 +1,7 @@ +Prism.languages.jsonp = Prism.languages.extend('json', { + 'punctuation': /[{}[\]();,.]/ +}); + +Prism.languages.insertBefore('jsonp', 'punctuation', { + 'function': /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/ +});