[Chore] Upgraded hljs.highlight API.

The old API, (lang, code, ...args), is now deprecated.
This commit is contained in:
Fabio Manganiello 2023-12-16 23:49:25 +01:00
parent b916c98b70
commit 5972c728a4
Signed by: blacklight
GPG key ID: D90FBA7F76362774
4 changed files with 6 additions and 6 deletions

View file

@ -269,9 +269,9 @@ export default {
highlightedCurlSnippet() { highlightedCurlSnippet() {
return hljs.highlight( return hljs.highlight(
'bash',
'# Note: Replace the cookie with a JWT token for production cases\n' + '# Note: Replace the cookie with a JWT token for production cases\n' +
this.curlSnippet this.curlSnippet,
{language: 'bash'}
).value ).value
}, },
}, },

View file

@ -46,7 +46,7 @@ export default {
jsonResponse() { jsonResponse() {
if (this.isJSON) { if (this.isJSON) {
return hljs.highlight('json', this.response).value return hljs.highlight(this.response, {language: 'json'}).value
} }
return null return null

View file

@ -49,9 +49,9 @@ export default {
computed: { computed: {
highlightedConfigSnippet() { highlightedConfigSnippet() {
return hljs.highlight( return hljs.highlight(
'yaml',
`# Configuration template. You can add it to ${this.configFile}\n` + `# Configuration template. You can add it to ${this.configFile}\n` +
this.extension.config_snippet, this.extension.config_snippet,
{language: 'yaml'}
).value.trim() ).value.trim()
}, },

View file

@ -88,13 +88,13 @@ export default {
return ( return (
this.installCmd ? this.installCmd ?
hljs.highlight( hljs.highlight(
'bash',
this.extension.deps.install_cmd this.extension.deps.install_cmd
.map((cmd) => `$ ${cmd}`) .map((cmd) => `$ ${cmd}`)
.join('\n') .join('\n')
.trim() .trim()
).value : ).value :
'# No extra installation steps required' '# No extra installation steps required',
{language: 'bash'}
) )
}, },
}, },