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

文章中带图片文件怎么操作? #2

Open
renshinizhenhao opened this issue Nov 9, 2023 · 3 comments
Open

文章中带图片文件怎么操作? #2

renshinizhenhao opened this issue Nov 9, 2023 · 3 comments

Comments

@renshinizhenhao
Copy link

文章中带图片文件,这样发布之后我去浏览器看了这篇文章。图片是不显示的。

@qqxpee
Copy link

qqxpee commented Nov 9, 2023

先用图床咯,Upload images还在作者的TODO列表里面

@ruibaby
Copy link
Member

ruibaby commented Nov 9, 2023

目前的问题是:

  1. Obsidian 是基于 Electron 开发的,对于请求 Halo 的接口来说相当于是在浏览器上请求的,所以存在跨域问题。
  2. Obsidian 是提供了 requestUrl 的 API 用于在 Node 环境请求接口以规避跨域问题,但目前尝试通过 requestUrl API 来上传附件,要么导致上传的图片无法加载(损坏),要么无法正常上传。requestUrl 的封装并不像使用 Axios 上传文件那么方便。

如果社区的人有类似的经验,欢迎提供想法和 PR。

@Nanoicehat
Copy link

我使用Obsidian来写笔记,其中的插件Regex Pipeline,可以支持正则转换,这是我用于Obsidian和Halo之间图片路径转换的正则"![(.?)](attachments(.?))"gm->"$1"和"![(.?)](/upload(.?))"gm->"$1",前者将Obsidian转为Halo,后者反之

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants