Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文章编辑器嵌入网页支持配置宽高等参数 #2985

Closed
wan92hen opened this issue Dec 16, 2022 · 5 comments · Fixed by halo-sigs/richtext-editor#2
Closed

文章编辑器嵌入网页支持配置宽高等参数 #2985

wan92hen opened this issue Dec 16, 2022 · 5 comments · Fixed by halo-sigs/richtext-editor#2
Assignees
Labels
area/editor Issues or PRs related to the Editor kind/improvement Categorizes issue or PR as related to a improvement. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Milestone

Comments

@wan92hen
Copy link
Collaborator

你当前使用的版本

2.0.2

描述一下此特性

在文章中嵌入网页时只能输入 URL 地址,不能调整宽度、高度及其他 iframe 参数,自动生成的页面高度大部分情况下都不太合适。
image

希望可以有对应配置手动指定高度、宽度等参数,或者能够根据页面内容自动设置合适的高度。

附加信息

No response

@JohnNiang
Copy link
Member

/kind improvement
/area editor

@f2c-ci-robot f2c-ci-robot bot added kind/improvement Categorizes issue or PR as related to a improvement. area/editor Issues or PRs related to the Editor labels Dec 16, 2022
@ruibaby
Copy link
Member

ruibaby commented Dec 16, 2022

/milestone 2.1.x

@f2c-ci-robot f2c-ci-robot bot added this to the 2.1.x milestone Dec 16, 2022
@ruibaby ruibaby modified the milestones: 2.1.x, 2.2.x Dec 29, 2022
@ruibaby ruibaby added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jan 3, 2023
@ruibaby
Copy link
Member

ruibaby commented Jan 6, 2023

在文章中嵌入网页时只能输入 URL 地址,不能调整宽度、高度及其他 iframe 参数

目前已经在 halo-sigs/richtext-editor#2 中实现了预设的宽高+自定义宽高设置。这里说的其他 iframe 可以举一些例子吗?

MDN 关于 iframe 的文档中提到,似乎很多参数已经不被推荐使用:https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe#%E4%B8%8D%E8%B5%9E%E6%88%90%E4%BD%BF%E7%94%A8%E7%9A%84%E5%B1%9E%E6%80%A7

@wan92hen
Copy link
Collaborator Author

wan92hen commented Jan 6, 2023

<iframe src="//player.bilibili.com/player.html?aid=434483618&bvid=BV1h3411D76J&cid=949353264&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="false"> </iframe>

iframe 的其他属性可能确实不那么常用,这里考虑的可能是另一个问题。
以B站为例,选择嵌入网页方式分享时,复制的内容是包含完整 iframe 标签的 HTML 代码,里面有附带一些属性。其他网站复制出来的大部分也是完整 iframe 标签的代码,用在 Halo 这里的话需要单独再把里面的 src 部分复制粘贴进来。
这里是不是可以考虑允许直接粘贴 iframe,编辑器自动给处理一把呢?

@ruibaby
Copy link
Member

ruibaby commented Jan 6, 2023

这里是不是可以考虑允许直接粘贴 iframe,编辑器自动给处理一把呢?

已在 halo-sigs/richtext-editor#2 的最新提交中实现。

@JohnNiang JohnNiang modified the milestones: 2.2.x, 2.2.0 Jan 31, 2023
@ruibaby ruibaby modified the milestones: 2.2.x, 2.2.0 Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor Issues or PRs related to the Editor kind/improvement Categorizes issue or PR as related to a improvement. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants