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?
펜스 렌더러(md.renderer.rules.fence)를 오버라이드하려고 할 때 동일한 문제가 발생합니다. 미리보기 창에서는 정상적으로 작동하지만, 제출 후에는 기본 Discourse 렌더링 결과가 표시됩니다.
다음은 해당 코드입니다:
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">Copy and paste this code into n8n to play with the workflow</div>' +
tokens[idx].content +
'</div>'
};
});
}