Docsify does not preserve alias when importing an image
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
从链接的 CodeSandbox 及其 README.md 开始,然后使用 serialization.md 中的图像示例重现别名情况。跟踪 Docsify 对带别名图像 URL 的处理,并针对全部四种图像形式验证修复,包括预期的带别名输出。
由索引模型根据 Issue 内容生成。
描述
Bug Report
Steps to reproduce
This page https://github.com/hamishwillee/mavlink-devguide/blob/demo_for_but/en/guide/serialization.md displays four images.
- The first two display an image in an /assets/ folder using absolute and relative paths.
- The second two display the same image in the same folder.
1.

2.

3.

4.
<img src="packet_mavlink_v2.jpg" title="MAVLink v2 packet">
If I display this page using an alias none of the images are displayed;
'/en/(.*)':
'https://raw.githubusercontent.com/hamishwillee/mavlink-devguide/docsify_test/en/$1'
YOu can see why here - the assets folder is not found - either it can't find the assets folder, or it is looking in the root, or it is looking in the right folder locally, and not on the aliased site.

I think it should search the relative path of the alias to construct the URL.
What is current behaviour
If you load a markdown file using an alias images listed in that file cannot be imported.
What is the expected behaviour
If you import a file via an alias its images should be displayed
Other relevant information
I think this is the same thing reported in https://github.com/docsifyjs/docsify/issues/1436#issuecomment-737107674
The had a horrible hack to hard code what site they are on into the URL. I'd be OK with that if you could get the information for your current context dynamically maybe, but I'd still hope this bug would be fixed.
-
[ x] Bug does still occur when all/other plugins are disabled?
-
Your OS: Windows 11
-
Node.js version: v16.15.0
-
npm/yarn version: yarn 1.22.5
-
Browser version: Latest Firefox and Chrome
-
Docsify version: 4.x
-
Docsify plugins: None
Please create a reproducible sandbox
[](https://codesandbox.io/s/late-dawn-tvrd7w?file=/README.md)
- click the link to display a test page that loads images
Mention the docsify version in which this bug was not present (if any)
All
- 主要语言
- JavaScript
- 星标
- 31.5k
- 派生
- 5.8k
- 平均合并
- 2 天 14 小时
- 30 天内合并 PR
- 5
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docsifyjs/docsify 的其他 Issue
-
Query parameter values are truncated at a second equals sign可能已有人在做 @xu91102 于 22 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
bug Triage
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 2 天内回复
-
Cached AJAX responses lose status metadata exposed through vm.route.response可能已有人在做 @xu91102 于 22 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 2 天内回复
-
In the Edge browser, the character `{docsify-updated}` is not replaced可能重新可做 @AmanUllah687 于 75 天前认领,目前没有进行中的 PR。 未关闭wait for information
难度 4/5 3-5 天 新手友好度 35/100
docsifyjs/docsify#2681 · 11 条评论 ·
维护者通常 2 天内回复
-
feature request Triage
难度 4/5 3-5 天 新手友好度 38/100
docsifyjs/docsify#2643 · 5 条评论 ·
维护者通常 2 天内回复
查看 docsifyjs/docsify 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
521xueweihan/HelloGitHub#4025 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
iib0011/omni-tools#479 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 67/100
pixelfed/pixelfed-rn#508 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复