feat: add code highlighting to descriptions in the new editor (#43740)
parent
b0d48b8463
commit
580f57cf5f
|
@ -7,6 +7,7 @@ import type {
|
|||
Range as RangeType
|
||||
// eslint-disable-next-line import/no-duplicates
|
||||
} from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
import { highlightAllUnder } from 'prismjs';
|
||||
import React, {
|
||||
useEffect,
|
||||
Suspense,
|
||||
|
@ -450,6 +451,7 @@ const Editor = (props: EditorProps): JSX.Element => {
|
|||
descContainer.appendChild(jawHeading);
|
||||
descContainer.appendChild(desc);
|
||||
desc.innerHTML = description;
|
||||
highlightAllUnder(desc);
|
||||
// TODO: the solution is probably just to use an overlay that's forced to
|
||||
// follow the decorations.
|
||||
// TODO: this is enough for Firefox, but Chrome needs more before the
|
||||
|
|
Loading…
Reference in New Issue