收藏
回答

第三方发表素材文章,iframe会被过滤?

第三方发表素材文章时,content字段会自动过滤掉iframe

上传时content为

<section><iframe class="video_iframe rich_pages" data-vidtype="2" data-mpvid="wxv_1681892499969130499" data-cover="http%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fv1fXoxic4bPe4ZAjLMskcgd8CGiaTSn9NnuOGWJP9LD6iadyIFJJssGeA3xTvdcTibElT6tBkDM31c9W5cVSHdV8icA%2F0%3Fwx_fmt%3Djpeg" allowfullscreen="" frameborder="0" style="  z-index:1; " data-ratio="1.7777777777777777" data-w="1920" src="https://mp.weixin.qq.com/mp/readtemplate?t=pages/video_player_tmpl&action=mpvideo&auto=0&vid=wxv_1681892499969130499"></iframe></section><br/>

返回content为

<section><iframe class="video_iframe rich_pages" data-vidtype="2" data-mpvid="wxv_1681892499969130499" data-cover="http%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Fv1fXoxic4bPe4ZAjLMskcgd8CGiaTSn9NnuOGWJP9LD6iadyIFJJssGeA3xTvdcTibElT6tBkDM31c9W5cVSHdV8icA%2F0%3Fwx_fmt%3Djpeg" allowfullscreen="" frameborder="0" style="  z-index:1; " data-ratio="1.7777777777777777" data-w="1920"></iframe></section><br  />

请问如何处理这一类的情况?

回答关注问题邀请回答
收藏

3 个回答

  • 雅人深致℃
    雅人深致℃
    2022-05-10

    iframe的确会过滤掉src 属性,需要设置一下data-src属性就行了

    2022-05-10
    有用
    回复
  • 微喵网络
    微喵网络
    2022-01-12

    肯定过滤啊,多危险,鬼知道iframe里会加载什么页面

    2022-01-12
    有用
    回复 3
    • 林进鑫
      林进鑫
      2022-01-12
      可是链接是微信的链接,之前是不会过滤的,这几天才发现过滤掉了
      2022-01-12
      回复
    • 林进鑫
      林进鑫
      2022-01-12
      问题解决了,谢谢
      2022-01-12
      回复
    • 清风予你
      清风予你
      2024-01-26回复林进鑫
      请问怎么解决的
      2024-01-26
      回复
  • 林进鑫
    林进鑫
    2022-01-12

    iframe 过滤了src属性

    2022-01-12
    有用
    回复
登录 后发表内容
问题标签