Hopefully this one is simpler and might elicit a response. One of the things we really like about strapi is discouraging users to be putting their own (terrible) html code into the content, and allows us to be more rigid on how pages will display. The majority of our content blocks are text fields, but in some circumstances where the content needs to link to either internal or external page, because there is no great solution for that, we have resorted to using markdown textboxes. It’s not as terrible as html encoded into the content. However we are struggling a bit with line-breaks; Strapi seems to render the markdown differently to how other markdown renderers:
But take your favorite markdown renderer. When I’ve used markdown it has always been paragraph aware; meaning if I type a chunk of text and hit enter twice, and then start typing another chunk of text the markdown will render that as two separate paragraphs. Strapi does not. And this then leads us to having to encourage users to engage in behavior we would rather discourage, such as needing to use html linebreaks
in the middle of content. Once the Pandora’s box of html-in-content is opened, experience tells us it will be difficult to close.
Any suggestions for either a) why Strapi is rendering the markdown differently (I’m well aware that Strapi did not write the markdown renderer, but they may be sufficiently familiar with that library that they could help explain how to achieve what we want, or why it might be doing this), or b) ways of achieving line breaks avoiding the ugly html? https://www.markdownguide.org tells us that either two spaces at the end of the line, or the
tag should be sufficient. However, the whole 2 spaces thing seems to be a red herring, or maybe we’re seeing versioning issues there - some renderers support the two spaces but the vast majority do not, despite advertising that they do.
As usual, any feedback appreciated
Thanks!
Pete.
This topic has been created from a Discord post (1288004825572708383) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord