My markdown extension works in preview but not on cooked


#1

I have followed these instructions to create a Block BBCode markdown extension for Discourse.

The plugin works when previewing and editing a topic. However, when I actually post the Topic, the raw BBCode mark up appears in the post completely unprocessed.

Is there something I need to do to make sure the plugin operates on posted topics?


Developer's guide to Markdown extensions
(Rafael dos Santos Silva) #2

I’ve had this happen due to importing modules using Javascript import statement, and the differences in paths between the browser and the mini_racer.

Can you share your plugin code so we can help you to debug?


#3

Thank you for the reply Rafael.

The plugin’s code is here:

As you can see it is very simple. I am using ES Module imports, but only for adding a button to the editing bar. The Markdown extension (assets/javascripts/lib/markdown-it/snippets.js.es6 · master · Text Blaze / Discourse Snippets · GitLab) doesn’t import anything.


(Sam Saffron) #4

I think this is simple naming issue due to:

Move it from markdown-it to the discourse-markdown directory.


#5

That fixed it. Thank you Sam.