我试图创建一个系统管理的帖子,该帖子在开发中的网站插件上使用原始 HTML。查看文档和各种帖子后,我认为我采取了正确的方法,但预处理器仍然将我的帖子中的各个部分转义为 <code>。
实际效果如下:
预期效果如下(我在浏览器中进行了编辑):
以下是我用于创建帖子的代码:
post = PostCreator.new(Discourse.system_user,
title: mmbill.getTitle(),
raw: cooked,
cooked: cooked,
cook_methods: Post.cook_methods[:raw_html],
archetype: 'regular',
created_at: createdAt,
skip_validations: true,
category: Mmbill.getCatId(),
is_warning: false,
meta_data: { mm_type: 'bill', mm_id: final[:bill_id] },
shared_draft: false,
topic_opts: {}
)
感谢您的任何帮助!


