-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
国内引入jsrun.net代码分享预览提高可玩性 #906
Comments
看上去好像是直接嵌入一个 iframe 就可以了? |
确实是的😂,我之前看react native官网也是通过iframe实现的 |
补充举例codepen <iframe height="265" style="width: 100%;" scrolling="no" title="VwKJopR" src="https://codepen.io/herberthe/embed/preview/VwKJopR?height=265&theme-id=light&default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/herberthe/pen/VwKJopR'>VwKJopR</a> by Herbert
(<a href='https://codepen.io/herberthe'>@herberthe</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe> 其格式为 <iframe height="<高度>" style="width: 100%;" scrolling="no" title="<demo编号>" src="//codepen.io/<用户名>/embed/preview/<demo编号>?height=<高度>&theme-id=<主题>&default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"></iframe>
如果是codepen的话,可以将配置文件设成下面这样配置文件语言类型使用保留字
<iframe height="300" style="width: 100%;" scrolling="no" title="VwKJopR" src="//codepen.io/herberthe/embed/preview/VwKJopR?height=300&theme-id=light&default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"></iframe> |
vditor 已支持 iframe 嵌入,直接输入就可以哦。 |
嗷嗷,谢谢 |
@Vanessa219 不过好像还是有一个问题,如果用户用iframe插入广告这不是不可控了吗 |
那可能需要自己建立一个白名单或者黑名单 |
😭那也行 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你在什么场景下需要该功能?
在前端里,分享设计与代码是很酷的玩法,国外有codepen和jsfiddle,国内目前很爽的方案有jsrun.net。通过代码的分享在线渲染会提高可玩性,促进代码水平的提高。
描述最优的解决方案
为了减少学习成本和实现难度,结合jsrun.net给的内嵌选项,有下面的思考解决方案
描述候选解决方案
与上面同理, codepen等其他的也可以通过配置文件的方式来进行配置,文件格式改为下面那样
其他信息
The text was updated successfully, but these errors were encountered: