Merge pull request #6973 from matrix-org/dbkr/upgrade_highlightjs

Upgrade highlight.js
This commit is contained in:
David Baker 2021-10-18 19:52:34 +01:00 committed by GitHub
commit 98ba3fd6e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 32 deletions

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React from 'react';
import { highlightBlock } from 'highlight.js';
import highlight from 'highlight.js';
import { replaceableComponent } from "../../../utils/replaceableComponent";
interface IProps {
@ -33,7 +33,7 @@ export default class SyntaxHighlight extends React.Component<IProps> {
// componentDidUpdate used here for reusability
public componentDidUpdate(): void {
if (this.el) highlightBlock(this.el);
if (this.el) highlight.highlightElement(this.el);
}
// call componentDidUpdate because _ref is fired on initial render