Markdown Not Interpreted When Pulled from Page w/ Embedded Discussion

AI-generated summary

The discussion addresses an issue where Markdown is not interpreted when topics are generated via Discourse’s embedded discussions feature. Winsomniak reports that embedded content pulled from a webpage (e.g., from #copyme) displays Markdown literally instead of rendering it, though editing the post previously triggered correct rendering — a behavior now fixed by @gerhard to respect cook_method, which inadvertently broke Markdown support during edits techAPJ. techAPJ clarifies this is a feature request, not a bug, since embedded content is assumed to be HTML (using raw_html cook method). The proposed solution — adding a new site setting to control cook_method — has been implemented: a new setting, embed support markdown (default off), now allows embedded topics to render Markdown identically to topics composed directly in Discourse techAPJ. This resolves the issue without requiring manual HTML editing, improving usability for sites relying on Markdown in embedded content.

Please correct me if I am wrong, but it seems to me that markdown is not being interpreted when topics are generated via the embedded discussions feature.

This is a generated topic from the following page: https://kagerochart.com/hero/tobin-the-clueless-one

I have configured Discourse to pull the contents of #copyme, which it does. However, the copied text is displaying literally.

As you can see in the screenshot, when I click the edit button, the preview is correct. If I make an update to the post, the markdown is interpreted.

Thanks

1 me gusta

This is not a bug but a feature request.

Currently we are assuming that the embedded content will be HTML, so the cook_method is set to raw_html as per this code.

The better solution here is to add a new site setting to control cook_method for embedded topics.

pr-welcome

4 Me gusta

This was because when editing a post we were ignoring cook_method , @gerhard recently fixed this via:

https://github.com/discourse/discourse/commit/4205c1ad2bcbd2572fb4b7eb37c641a4c4db5cec

So now when editing the embedded topic the markdown will not work, which seems like a bug to me.

I have added this to my priority list since there is no workaround now except to edit a post in HTML format, which is not convenient.

6 Me gusta

Done via:

https://github.com/discourse/discourse/commit/12706c4b295d260bbf34f5a8afc7e31971b3ea45

There is a new site setting embed support markdown (default off), if enabled the rendering will be same as what we have for topics created on Discourse composer.

6 Me gusta