Skip to content

Commit c660dac

Browse files
authored
build: fix deprecation warning from highlightjs (#23280)
Fixes the following deprecation warning that is logged by `highlightjs`: ``` Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. Deprecated as of 10.7.0. Please use highlight(code, options) instead. highlightjs/highlight.js#2277 ```
1 parent 51796e1 commit c660dac

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
"gulp": "^4.0.2",
183183
"gulp-cli": "^2.3.0",
184184
"gulp-dart-sass": "^1.0.2",
185-
"highlight.js": "^10.4.0",
185+
"highlight.js": "^10.7.0",
186186
"husky": "^7.0.1",
187187
"inquirer": "^8.0.0",
188188
"jasmine": "^3.6.0",

tools/highlight-files/highlight-code-block.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ const highlightJs = require('highlight.js');
77
*/
88
export function highlightCodeBlock(code: string, language: string) {
99
if (language) {
10-
return highlightJs.highlight(
11-
language.toLowerCase() === 'ts' ? 'typescript' : language, code).value;
10+
return highlightJs.highlight(code, {
11+
language: language.toLowerCase() === 'ts' ? 'typescript' : language
12+
}).value;
1213
}
1314

1415
return code;

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7158,7 +7158,7 @@ header-case@^2.0.4:
71587158
capital-case "^1.0.4"
71597159
tslib "^2.0.3"
71607160

7161-
highlight.js@^10.4.0:
7161+
highlight.js@^10.7.0:
71627162
version "10.7.3"
71637163
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531"
71647164
integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==

0 commit comments

Comments
 (0)