上传图像到仓库使用VS Code

huangapple go评论63阅读模式
英文:

Uploading image to repo using VS Code

问题

我一直在苦苦思索为什么我的 Jekyll 页面无法显示图像,感觉自己一直在徒劳地尝试。后来我发现有一些编码字符在文件名中,但我无法看到它们。

看起来是 VS Code 在我编辑博客文章的 Markdown 文件时插入了编码字符。它在路径中的文件名前添加了[U+200E]。以下是我在 VS Code 编辑器中打开正在编辑的 .md 文件时看到的内容:

![PEGA - 4 timeframes]({{ site.url }}{{ site.baseurl }}/assets/images/‎[U+200E]PEGA4tf.png)

你知道为什么 VS Code 会坚持插入编码字符吗?但我在 GitHub 页面编辑文件时看不到这个字符。

英文:

I was beating my head against a wall trying to figure out why I couldn't get an image to display in my Jekyll page. I figured out there were some encoded characters that I couldn't see in the filename.

It looks like VS Code inserted encoding when I edited the markdown file for my post. It added a [U+200E]before the filename in the path. Here's what I see in the VS Code editor when I open the .md file I'm editing

![PEGA - 4 timeframes]({{ site.url }}{{ site.baseurl }}/assets/images/‎[U+200E]PEGA4tf.png)

Any ideas why VS Code insists on inserting an encoding character? I don't see the character when I edit the file from the GitHub page.

答案1

得分: 0

我想我刚刚回答了自己的问题。原始图像文件名中有空格,而VS Code显然对文件名中的任何空格都不太友好。这是一个容易解决的问题。

英文:

I think I just answered my own question. The original image filename had white spaces in it, and VS Code apparently doesn't respond well to any whitespace in the filename. That's an easy problem to fix.

huangapple
  • 本文由 发表于 2023年7月10日 22:58:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76655001.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定