1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

latex math as labs setting

This commit is contained in:
Aleks Kissinger
2020-10-10 16:32:49 +01:00
parent 919a1a8125
commit 96742fc309
4 changed files with 12 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ import EMOJIBASE_REGEX from 'emojibase-regex';
import url from 'url';
import katex from 'katex';
import { AllHtmlEntities } from 'html-entities';
import SdkConfig from './SdkConfig';
import SettingsStore from './settings/SettingsStore';
import {MatrixClientPeg} from './MatrixClientPeg';
import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/Permalinks";
@@ -412,7 +412,7 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts
if (isHtmlMessage) {
isDisplayedWithHtml = true;
safeBody = sanitizeHtml(formattedBody, sanitizeParams);
if (SdkConfig.get()['latex_maths']) {
if (SettingsStore.getValue("feature_latex_maths")) {
const mathDelimiters = [
{ pattern: "<div data-mx-maths=\"([^\"]*)\">(.|\\s)*?</div>", display: true },
{ pattern: "<span data-mx-maths=\"([^\"]*)\">(.|\\s)*?</span>", display: false },