gpt4 book ai didi

javascript - 属性从 iframe 标记中剥离

转载 作者:行者123 更新时间:2023-11-28 09:24:49 25 4
gpt4 key购买 nike

我想使用 wysihtml5-0.4.0pre 在我的内容中使用 iframe,我添加了

"iframe": {
"remove": 0
}

到我的 parserRules 并传递 iframe 标记,但删除所有属性(src、宽度、高度等)。这种情况发生在哪里以及我能做什么?

最佳答案

您需要将属性列入白名单。将以下内容添加到解析器规则中应该可以解决问题(它将设置宽度和高度并允许有效的 src):

"iframe": {
"check_attributes": {
"src": "url"
},
"set_attributes": {
"width": "560",
"height": "315",
"frameborder": "0"
}
}

关于javascript - 属性从 iframe 标记中剥离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14543914/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com