You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Quarto转Markdown为RevealJS时,Desmos嵌入iframe无法加载如何解决?

解决Quarto RevealJS嵌入Desmos iframe无法加载的问题

常见修复方案:

  • 取消HTML实体转义
    你当前代码里用了&lt;和&gt;转义HTML标签,Quarto不会将其解析为实际的<iframe>元素,直接使用原生<iframe>标签即可。

  • 调整embed-resources配置
    embed-resources: true会把所有资源打包成单文件,可能触发浏览器同源策略限制,导致远程iframe无法加载。可以将该选项设为false,或者在不需要全资源嵌入时移除该配置。

  • 使用Quarto内置iframe短代码
    Quarto提供了专门的iframe短代码,比直接写HTML更适配RevealJS环境,能避免解析问题。

修改后的可运行示例:

方案一:使用Quarto iframe短代码

---
format:
  revealjs:
    embed-resources: false
---

#### A cool interactive graph

{{< iframe src="https://www.desmos.com/calculator/8wiixd9ks4?embed" width="500" height="500" style="border: 1px solid #ccc" >}}

方案二:使用原生HTML标签

---
format:
  revealjs:
    embed-resources: false
---

#### A cool interactive graph

<iframe src="https://www.desmos.com/calculator/8wiixd9ks4?embed" width="500" height="500" style="border: 1px solid #ccc" frameborder="0"></iframe>

内容的提问来源于stack exchange,提问作者rturquier

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 08:52:03