mirror of https://github.com/vector-im/riot-web
Merge pull request #6350 from SimonBrandner/fix/dont-auto-detect-lang/12366
Don't autodetect language in inline code blockspull/21833/head
commit
ebd64eb53c
|
@ -244,7 +244,11 @@ export default class TextualBody extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private highlightCode(code: HTMLElement): void {
|
private highlightCode(code: HTMLElement): void {
|
||||||
if (SettingsStore.getValue("enableSyntaxHighlightLanguageDetection")) {
|
// Auto-detect language only if enabled and only for codeblocks
|
||||||
|
if (
|
||||||
|
SettingsStore.getValue("enableSyntaxHighlightLanguageDetection") &&
|
||||||
|
code.parentElement instanceof HTMLPreElement
|
||||||
|
) {
|
||||||
highlight.highlightBlock(code);
|
highlight.highlightBlock(code);
|
||||||
} else {
|
} else {
|
||||||
// Only syntax highlight if there's a class starting with language-
|
// Only syntax highlight if there's a class starting with language-
|
||||||
|
|
Loading…
Reference in New Issue