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

relative paths outside of src directory don't work #2258

Open
djukyo opened this issue Dec 4, 2023 · 3 comments
Open

relative paths outside of src directory don't work #2258

djukyo opened this issue Dec 4, 2023 · 3 comments
Labels
A-HTML Area: HTML Rendering C-question Category: A question on how to do something

Comments

@djukyo
Copy link

djukyo commented Dec 4, 2023

Question

We know that Markdown perfectly supports GIF images, but it seems that mdBook does not. What is the community's stance on this feature?

Version

No response

@djukyo djukyo added the C-question Category: A question on how to do something label Dec 4, 2023
@KFearsoff
Copy link
Contributor

Well, Markdown supports GIF images because HTML does, without any additional tags. GIF, even the animated one, is just an image, and browser plays it automatically. So it sounds weird hearing that mdbook doesn't support GIF images, as it just renders the HTML. Could you please provide some test cases and see if the issue reproduces?

@rustbot label +A-HTML +S-waiting-on-author

@rustbot rustbot added A-HTML Area: HTML Rendering S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Dec 6, 2023
@djukyo
Copy link
Author

djukyo commented Dec 6, 2023

J.D@B14 MSYS ~/D/W/84fa2e05
# find . -name 002-rust-hello.gif
./book/assets/002-rust-hello.gif
./resource/rec/002-rust-hello.gif   <== in location 'a'
./src/assets/002-rust-hello.gif   <== in location 'b'

J.D@B14 MSYS ~/D/W/84fa2e05
# head src/001-序言.md -n 5 <== Markdown source code
# 序言

![rust hello](../resource/rec/002-rust-hello.gif) <== This line doesn't work for mdBook but works for other IDEs or browsers.
![git](assets/002-rust-hello.gif) <== This line works for mdBook.

I apologize for the oversight in my previous testing.
Let me provide a conclusion first: mdBook can display gif in some cases, but not in others.

Now, I'll provide specific cases I encountered:

  1. For path "a," the gif file is outside the src directory.
  2. For path "b," the gif file is inside the src directory.
  3. I guess, it's related to the path.

@KFearsoff
Copy link
Contributor

Hmm. Yeah, looks like it's the issue with paths. Path handling in mdbook is definitely weird in some cases: #1883, #1753. I wouldn't be surprised if this is due to the path handling we have.

From what I understand, it doesn't seem like anyone is currently working on it, but it would be indeed great to fix.

@rustbot label -S-waiting-on-author

@rustbot rustbot removed the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Dec 6, 2023
@ehuss ehuss changed the title mdBook and GIF Support: Community Perspective relative paths outside of src directory don't work Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-HTML Area: HTML Rendering C-question Category: A question on how to do something
Projects
None yet
Development

No branches or pull requests

3 participants