Skip to content

Commit 28ae9c6

Browse files
Copilotchagong
andauthored
Fix highlight.js v11 API compatibility (#1568)
* Initial plan * Initial plan for highlight.js upgrade Co-authored-by: chagong <831821+chagong@users.noreply.github.com> * Fix highlight.js API usage for v11 compatibility Co-authored-by: chagong <831821+chagong@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: chagong <831821+chagong@users.noreply.github.com>
1 parent f27386f commit 28ae9c6

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

package-lock.json

Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/formatter-settings/assets/features/formatterSettings/components/Highlight.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Licensed under the MIT license.
33

44
import * as React from "react";
5-
import * as hljs from "highlight.js";
5+
import hljs from "highlight.js";
66
import "../../../../../../webview-resources/highlight.css";
77

88
export function highlight(content: string): JSX.Element {
9-
const highlighted = hljs.highlight("java", content);
9+
const highlighted = hljs.highlight(content, { language: "java" });
1010
return (
1111
<pre className="hljs d-flex flex-grow-1">
1212
<code className="hljs flex-grow-1" dangerouslySetInnerHTML={{ __html: highlighted.value }} />

0 commit comments

Comments
 (0)