Website: Upgrade highlight.js dependency to improve syntax highlighting on documentation pages (#12370)

Closes: #12214

Changes:
- Upgraded the version of highlight.js we're using from `v9.10.0` to
`v10.7.3` to add support for YAML syntax highlighting.
- Updated highlight.js usage (`hljs.highlightBlock()`»
`hljs.highlightElement()`)
This commit is contained in:
Eric 2023-06-16 03:07:06 -05:00 committed by GitHub
parent 74af345f74
commit d676118307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1360 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -132,7 +132,7 @@ parasails.registerPage('basic-documentation', {
// https://github.com/sailshq/sailsjs.com/blob/7a74d4901dcc1e63080b502492b03fc971d3d3b2/assets/js/functions/sails-website-actions.js#L177-L239
(function highlightThatSyntax(){
$('pre code').each((i, block) => {
window.hljs.highlightBlock(block);
window.hljs.highlightElement(block);
});
// Make sure the <pre> tags whose code isn't being highlighted

View File

@ -88,7 +88,7 @@ parasails.registerPage('osquery-table-details', {
}
$(block).html(replacementHMTL);
// After we've highlighted our keywords, we'll highlight the rest of the codeblock
window.hljs.highlightBlock(block);
window.hljs.highlightElement(block);
});
// Adding [purpose="line-break"] to SQL keywords if they are one of: SELECT, WHERE, FROM, JOIN. (case-insensitive)
$('.hljs-keyword').each((i, el)=>{