mattermost-mobile/app/components/markdown/index.ts
Mattermost Build 8b58fdbe2f
MM-53107 Add limit to Markdown nodes (#7528) (#7535)
* MM-53107 Add limit to Markdown nodes

* Update commonmark to published version

* Rename field to camel case for consistency

* Update Markdown tests for removed children

(cherry picked from commit 2651dd31e1)

Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
2023-09-07 10:46:03 -03:00

26 lines
921 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
import withObservables from '@nozbe/with-observables';
import React from 'react';
import {observeConfigBooleanValue, observeConfigIntValue} from '@queries/servers/system';
import Markdown from './markdown';
import type {WithDatabaseArgs} from '@typings/database/database';
const enhanced = withObservables([], ({database}: WithDatabaseArgs) => {
const enableLatex = observeConfigBooleanValue(database, 'EnableLatex');
const enableInlineLatex = observeConfigBooleanValue(database, 'EnableInlineLatex');
const maxNodes = observeConfigIntValue(database, 'MaxMarkdownNodes');
return {
enableLatex,
enableInlineLatex,
maxNodes,
};
});
export default withDatabase(enhanced(React.memo(Markdown)));