Contentful logo

Contentful Community

Character limit on Markdown text fields

Hey. We have an issue with how the character limit validation works on Markdown text fields within your editor. The character limit we wish to set for a field in Contenful is in the context of not having text overflow and affect the layout of our page if there is too much text when it is displayed in-page. E.g. a Hero banner on our home page with only enough space to fit about 200 characters before content beneath would be pushed down and mess up the layout. We also need our authors to be able to format that text and add links within this banner, so we’re using the Markdown field for this. The issue we have is, the character count validation in your editor is counting all Markdown characters before it is processed into the final formatted text. So a link in Markdown “My Link” is being counted as 34 chars including the Markdown formatting when we only care about the 7 characters of space that “My Link” will take up on our actual page. In other words, it seems we have no way of preventing an author from accidentally adding too much text that could mess up a layout without over-limiting them and them not having enough space if they need to add links and other Markdown formatting characters. Question is, is there a way to add a content field that allows for text formatting but with character limit validation that counts the characters after formatting is applied? Thanks!