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?
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?
Ho lo stesso problema quando provo a sovrascrivere il renderer dei fence (md.renderer.rules.fence) — funziona nella finestra di anteprima, ma dopo l’invio viene mostrato il renderer Discourse predefinito.
Ecco il codice:
export function setup(helper) {
if (!helper.markdownIt) return;
helper.allowList(['div.embedded_workflow', 'div.embedded_tip']);
helper.registerPlugin((md) => {
md.renderer.rules.fence = function (tokens, idx, options, env, slf) {
let content = tokens[idx].content;
return '<div class="embedded_workflow">' +
'<div class="embedded_tip">Copia e incolla questo codice in n8n per provare il workflow</div>' +
tokens[idx].content +
'</div>'
};
});
}
Puoi anche vedere la struttura completa del plugin qui. Qualsiasi aiuto sarebbe molto apprezzato!