[已解决] iframe或者custom frames有可能嵌入本地HTML吗?

如题,iframe或custom frames有可能嵌入本地HTML吗?试过iframe+app://local/绝对路径file:///绝对路径,都是一片空白?或者有无其他可以内嵌本地HTML文件的方法哇?

解决方法:Surfing插件自带嵌入HTML的功能,又自己写了一小段js调整高度,直接用的调整图片宽度的写法 ![[文件名|200]]

const { Plugin } = require("obsidian");

module.exports = class EmbedHeight extends Plugin {
  onload() {
    console.log("html height 启动成功");

    // 自动给所有HTML嵌入块设置高度
    setInterval(() => {
      const embeds = document.querySelectorAll(".internal-embed");

      embeds.forEach(embed => {
        const src = embed.getAttribute("src");
        const width = embed.getAttribute("width");

        // 只处理 html 文件 + 有数字的情况
        if (src?.endsWith(".html") && width) {
          embed.style.height = width + "px";
          embed.style.overflow = "auto";
          embed.style.display = "block";
        }
      });
    }, 200);
  }
};

应该需要借助插件。Obsidian从之前某个版本开始,为了安全性,禁止使用 file 协议的链接。

引用文件的时候,会转换成带一串随机数的自定义链接,比如:

app://634f4395c6f0563bc053d348652f3f7f6dd3/D:/aaa/bbb/ccc/ddd/xxx?1776326972366

那……有插件推荐吗?HTML Reader只能查看,不能嵌入orz

老师,我突然意识到一个问题,如果能想办法解决ob不识别html文件的问题,是不是就能解决内嵌本地文件了?不太清楚有没有可能做到()

因为我在折腾 css 片段,想用本地图片发现用不了,正在考虑 style setting加选项引用库里的图片,突然想到这个()