Skip to content

Commit 7cc2657

Browse files
committed
fix(highlight-code): fix regression code highlight behavior
Refs #7603
1 parent 7443b2e commit 7cc2657

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/core/components/highlight-code.jsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { CopyToClipboard } from "react-copy-to-clipboard"
99

1010
const HighlightCode = ({value, fileName, className, downloadable, getConfigs, canCopy, language}) => {
1111
const config = isFunction(getConfigs) ? getConfigs() : null
12-
const canSyntaxHighlight = get(config, "syntaxHighlight.activated", true)
13-
const highlighterStyle = getStyle(get(config, "syntaxHighlight.theme", "agate"))
12+
const canSyntaxHighlight = get(config, "syntaxHighlight") !== false && get(config, "syntaxHighlight.activated", true)
1413
const rootRef = useRef(null)
1514

1615
useEffect(() => {
@@ -62,11 +61,11 @@ const HighlightCode = ({value, fileName, className, downloadable, getConfigs, ca
6261
? <SyntaxHighlighter
6362
language={language}
6463
className={cx(className, "microlight")}
65-
style={highlighterStyle}
64+
style={getStyle(get(config, "syntaxHighlight.theme", "agate"))}
6665
>
6766
{value}
6867
</SyntaxHighlighter>
69-
: <pre className={cx(className + "microlight")}>{value}</pre>
68+
: <pre className={cx(className, "microlight")}>{value}</pre>
7069
}
7170

7271
</div>

0 commit comments

Comments
 (0)