让 Plone 接受任何 HTML 输入
以可重复的方式使 Plone WYSIWYG 和 HTML 输入接受所有元素和样式的最简单方法是什么?
用例
- 大量私人站点
- 受信任的编辑器
- 高级编辑器(能够生成手工制作的 HTML 并希望生成手工制作的 HTML)
在这些情况下,Plone 元素白名单更具阻碍性。
实施
- 附加产品,带有大按钮“禁用所有 HTML 安全性”
由于 HTML 过滤要求您手动输入每个 CSS 指令,因此它无论如何都不实用。一定有一个隐藏开关可以以某种方式关闭所有 HTML 过滤吗?
另外,Archetypes/Dexterity Rich text 字段是否可以轻松制作不安全的 HTML?
What's the easiest way, in repeatable manner, to make Plone WYSIWYG and HTML input accept all elements and styles?
The use case
- Lot of private sites
- Trusted editors
- Advanced editors (able to produce hand crafted HTML and want to produce hand crafted HTML)
Plone element whitelisting is more hinder in these kind of cases.
Implementation
- Add-on product, with big button "disable all HTML security"
Since HTML filtering wants you to type in every CSS directive by hand, it is not practical in any mean. There must be a hidden switch to turn off all HTML filtering somehow?
Also is it possible to make unsafe HTML easily possible for Archetypes/Dexterity Rich text fields?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是一个大按钮,但也不难。在 Zope 管理界面中,在 Plone 站点顶部,转至 Portal_transforms 并打开 safe_html 转换。通过在disable_transform字段中输入“1”并保存来禁用它。
如果有任何不受信任的内容作者或编辑,或者任何天真的从第三方网站复制代码并将其粘贴到编辑器中,则不应执行此操作。
It's not a big button, but it's not hard either. In the Zope Management Interface, at the top of a Plone site, go to portal_transforms and open the safe_html transform. Disable it by putting a "1" in the disable_transform field and saving.
This should not be done if there are any untrusted content authors or editors — or any naive enough to copy code from a third-party site and paste it into an editor.
您现在需要按照下面 David Glick 的链接帖子进行操作...但它非常复杂,我放弃了,而是倾向于使用 customOverrides 产品来插入我的 js。
http://glicksoftware.com/blog/disable-html-filtering
另外,Plone doco对此的看法是错误的(http://docs.plone.org/develop/plone/forms/wysiwyg.html#disabling-html-filtering-and-safe-html-transformation)并且需要更新并且老实说,对于新的采用者来说,这种事情会立即消失。
You now need to follow the linked post below by David Glick... but it's stupidly complicated and i gave up, instead favouring using customOverrides product to insert my js.
http://glicksoftware.com/blog/disable-html-filtering
Also, the Plone doco about this is wrong (http://docs.plone.org/develop/plone/forms/wysiwyg.html#disabling-html-filtering-and-safe-html-transformation) and needs to be updated and in all honesty this sort of thing is an instant turn off for would be new adopters.