Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

saqueib's avatar

How edit a reply fills Markdown in Laracasts forum model

I wanted to know how the edited reply is implemented. What I think it stores body in markdown and it's converted to HTML when requested by view.

But when you click on edit reply it doesn't make any ajax request to get the reply markdown to prefill the textarea.

Does anyone know how it's done? Is @JeffreyWay using some frontend HTML to markdown converter?

0 likes
4 replies
bobbybouwmann's avatar

The parsing of the markdown is done in the frontend itself. So only markdown goes from server to client, but the javascript converts everything. Because of this you can also edit it without doing a request ;)

erikverbeek's avatar

The conversion from markdown to html does seem to happen server side. As soon as you switch from the markdown edit mode to the preview mode, a request is sent to laracasts.com/markdown which returns the rendered html.

So it seems the JavaScript only holds the plain markdown text and will request a rendered html version each time you ask it to show the html preview.

1 like
JeffreyWay's avatar
Level 59

@erikverbeek is correct. The Markdown conversion is done on the server-side. I use the CommonMark Composer package.

Please or to participate in this conversation.