From 5972c728a45ca16d5178405795a13a66fc66e85f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 16 Dec 2023 23:49:25 +0100 Subject: [PATCH] [Chore] Upgraded `hljs.highlight` API. The old API, (lang, code, ...args), is now deprecated. --- .../http/webapp/src/components/Action/ActionEditor.vue | 4 ++-- .../backend/http/webapp/src/components/Action/Response.vue | 2 +- .../http/webapp/src/components/panels/Extensions/Config.vue | 2 +- .../http/webapp/src/components/panels/Extensions/Install.vue | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/Action/ActionEditor.vue b/platypush/backend/http/webapp/src/components/Action/ActionEditor.vue index e88e1601..aeb01799 100644 --- a/platypush/backend/http/webapp/src/components/Action/ActionEditor.vue +++ b/platypush/backend/http/webapp/src/components/Action/ActionEditor.vue @@ -269,9 +269,9 @@ export default { highlightedCurlSnippet() { return hljs.highlight( - 'bash', '# Note: Replace the cookie with a JWT token for production cases\n' + - this.curlSnippet + this.curlSnippet, + {language: 'bash'} ).value }, }, diff --git a/platypush/backend/http/webapp/src/components/Action/Response.vue b/platypush/backend/http/webapp/src/components/Action/Response.vue index d228be6e..e1bf0c65 100644 --- a/platypush/backend/http/webapp/src/components/Action/Response.vue +++ b/platypush/backend/http/webapp/src/components/Action/Response.vue @@ -46,7 +46,7 @@ export default { jsonResponse() { if (this.isJSON) { - return hljs.highlight('json', this.response).value + return hljs.highlight(this.response, {language: 'json'}).value } return null diff --git a/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue b/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue index 2d1d8f88..9061836f 100644 --- a/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue +++ b/platypush/backend/http/webapp/src/components/panels/Extensions/Config.vue @@ -49,9 +49,9 @@ export default { computed: { highlightedConfigSnippet() { return hljs.highlight( - 'yaml', `# Configuration template. You can add it to ${this.configFile}\n` + this.extension.config_snippet, + {language: 'yaml'} ).value.trim() }, diff --git a/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue b/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue index 5b174f53..1054c7fa 100644 --- a/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue +++ b/platypush/backend/http/webapp/src/components/panels/Extensions/Install.vue @@ -88,13 +88,13 @@ export default { return ( this.installCmd ? hljs.highlight( - 'bash', this.extension.deps.install_cmd .map((cmd) => `$ ${cmd}`) .join('\n') .trim() ).value : - '# No extra installation steps required' + '# No extra installation steps required', + {language: 'bash'} ) }, },