GrapesJS / GrapesJS/components-custom-code

iframe being rendered strangely in the canvas view

未关闭
#37 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
81
派生
47
PR 合并指标
30 天内没有已合并 PR

描述

Hello,

The issue described below can be reproduced on the official demo at https://grapesjs.com/demo.html

When I try to add an iframe in a custom code block, the view tends to replace the iframe by a div, which breaks the layout of the iframe. However, the model seems to have the correct iframe since it is shown correctly in the `view code` modal, or by using `editor.getHtml()`.

For example, if I add this iframe which is an embed YouTube video:
```html

```

This is what the canvas view will use, parts of the iframe attributes are now on a parent div:
```html






```

贡献指南

这个仓库没有索引到贡献指南

调研方向

Reproduce the iframe behavior in the official demo using a custom code block, then compare the canvas view with the view code modal and editor.getHtml(). Trace where the canvas replaces the iframe with a div and moves its attributes; done means the canvas preserves the iframe layout and remains consistent with the model output.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。