Meteor 如何清理服务器上的HTML-所见即所得
我刚安装好。在说明中,它说要清理服务器上的HTML,并将您发送到atmosphere以安装清理包。我已经安装了Meteor 如何清理服务器上的HTML-所见即所得,meteor,meteor-autoform,simple-schema,Meteor,Meteor Autoform,Simple Schema,我刚安装好。在说明中,它说要清理服务器上的HTML,并将您发送到atmosphere以安装清理包。我已经安装了djedi:sanitize html,但是我找不到任何关于如何将其与autoform和simple schema集成/使用的说明。我想我应该在模式中定义它。我是个笨蛋,所以我非常感谢你的指导 如果你想让我发布我的模式或其他东西,我可以 下面是一个示例代码: body: { type: String, label: "Enter Your Content here",
djedi:sanitize html
,但是我找不到任何关于如何将其与autoform和simple schema集成/使用的说明。我想我应该在模式中定义它。我是个笨蛋,所以我非常感谢你的指导
如果你想让我发布我的模式或其他东西,我可以 下面是一个示例代码:
body: {
type: String,
label: "Enter Your Content here",
optional: false,
autoValue: function(){
return Meteor.isServer ? sanitizeHtml( this.value ) : this.value;
},
autoform: {
afFieldInput: {
type: 'summernote',
class: 'editor' // optional
// settings: // summernote options goes here
}
}
}
这包含了使用HTML消毒剂的指南。请注意,该指南适用于节点,但对Meteor也应适用。