From ba8d19b5c9fb8ac27426c8eb00013ad414e50d76 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 11 Nov 2022 13:20:44 -0500 Subject: [PATCH] Increase markdown field char limit to 50k. Fixes #849 --- src/shared/components/common/markdown-textarea.tsx | 5 ++++- src/shared/utils.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 8cdfaadc..d58520fe 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -8,6 +8,7 @@ import { i18n } from "../../i18next"; import { UserService } from "../../services"; import { isBrowser, + markdownFieldCharacterLimit, markdownHelpUrl, mdToHtml, pictrsDeleteToast, @@ -143,7 +144,9 @@ export class MarkdownTextArea extends Component< required disabled={this.props.disabled} rows={2} - maxLength={this.props.maxLength.unwrapOr(10000)} + maxLength={this.props.maxLength.unwrapOr( + markdownFieldCharacterLimit + )} placeholder={toUndefined(this.props.placeholder)} /> {this.state.previewMode && diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 473993b2..6494a7d9 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -74,6 +74,7 @@ export const fetchLimit = 40; export const trendingFetchLimit = 6; export const mentionDropdownFetchLimit = 10; export const commentTreeMaxDepth = 8; +export const markdownFieldCharacterLimit = 50000; export const relTags = "noopener nofollow";