用户自定义样式帖子?

I’ve been testing a move to Discourse for my company’s community.

We were on Vanilla but we don’t plan to import it to Discourse.

However, one feature of Vanilla that our community really loves is the ability to write custom CSS, HTML to make styled posts. We have a fairly active group of users who offer design work to other users and they use those types of posts as a way of showing off their skill.

I understand how that activity seems counter to Discourse’ current product, but I’m wondering if anyone has ever successfully figured out a way to allow users to create styled posts on Discourse.

Would it help if they could use a limited set of divs which would be defined in site wide CSS?

See here:

Per post CSS would require a custom plugin at the moment, have not seen this request pop up too much over the years.

One thing you could lean on is Theme Creator, create and show themes without installing Discourse! this would allow your community to create full fledged Discourse themes and components.

Whoa, very cool. Thank you and please keep up the good work

Also, if someone creates a theme you want to share, your community’s admin can import it and enable anyone in the community to set it as their personal default.

请原谅我再次提及此事。本贴的原作者确实曾创建我们的社区,但已不再担任该职位。我承认自己对此一无所知,如果我的发言有失分寸,敬请见谅。但我们是否有可能采取某种措施,让用户能够在帖子中使用 .css 来为他们的主题创建带有样式的开篇帖?

最近的更新修复了该漏洞,但也导致他们之前使用的代码失效。

我试图理清这里的内容,但有些超出我的理解范围。是否有可能创建一个主题,让用户在帖子中使用 .css 而不影响安全性?

不太可能吧?如果你需要一个完整的 CSS 游乐场,建议使用像 codepen.com 这样的平台,而不是 Discourse。

我们已有一个现成的 Discourse 论坛。最近的补丁破坏了用于个性化线程的样式/代码(显然我们并非个例)。我们更希望能找到一种方法,允许使用 CSS 或 HTML 来实现这些功能,而不是关闭现有论坛并迁移到新系统。

Can you share your CSS? There might be selectors that were too strict and might need some “broadening”.

目前使用的是标准 Discourse,并通过插件启用了 BBcode 和 BBcode 颜色功能。据我理解,使用代码的能力已被加入白名单,但自安全更新后已无法正常工作。讽刺的是,正是我们发现了这一安全问题,从而导致了我们代码功能的失效。据告知,我们需要一个插件,但我实在没有时间和精力自己开发一个。

能否分享一些 BBCode 着色的示例?白名单可能过于严格了。

我们使用了以下插件:

以前,<span> 标签允许对帖子进行某些修改。之前的管理员已将其加入白名单。有用户发现了一个可能的点击劫持漏洞,我对此进行了报告,随后的更新禁用了 <span> 标签的使用。如果我们再次将其加入白名单,或许能暂时生效,但在任何新更新中很可能被清除。而使用正式的插件则不会出现这种情况(据我所知)。

我的意思是,你能分享一些带有 BBCode 着色但无法正常显示的帖子示例吗?这些插件是官方支持并受支持的。如果存在漏洞,我们会进行修复。

好的。

点击劫持的代码是由一位用户发现并转交给我的。
我不是程序员。关于这个漏洞,我所知道的全部信息就是别人告诉我的,具体是:

请注意,这个问题仅与 bbcode 和 bbcode-color 插件相关,因此并非所有 Discourse 站点都会受到影响。感谢您向我们反馈,我们一定会修复它。

我会通过私信发送相关信息,因为我不想在公开场合直接发布可能具有恶意的代码。