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

Can I read local images? #8

Open
lingtalfi opened this issue Sep 20, 2015 · 3 comments
Open

Can I read local images? #8

lingtalfi opened this issue Sep 20, 2015 · 3 comments

Comments

@lingtalfi
Copy link

Hi, can I insert inline local images?

I'm using the following command:

ghmarkdown -lsi myfile.txt

Then inside my markdown document, I have tried to insert an inline image (located inside the images folder next to myfile.txt):

![My alt description](images/image.jpg "my title description")
![My alt description](/images/image.jpg "my title description")
![My alt description](./images/image.jpg "my title description")

None of those work.
Is there anything to do about it, or do I have to switch to serve images from another (external) location?

@lingtalfi lingtalfi changed the title how can I read images? Can I read local images? Sep 20, 2015
@lorepozo
Copy link
Owner

To read local images, you could use the file protocol.

![my_image](file:///Users/lucasem/my_image.jpg "my_image")

@lingtalfi
Copy link
Author

Doesn't work for me.

@lorepozo lorepozo reopened this Sep 27, 2015
@lorepozo
Copy link
Owner

It's a bug with the GitHub markdown API:

curl --data '![my_image](file:///Users/lucasem/my_image.png "my_image")' -H "Content-type: text/plain" "https://api.github.com/markdown/raw"

yields

<p><a href="" target="_blank"><img alt="my_image" title="my_image" style="max-width:100%;"></a></p>

when it should output

<p><a href="file:///Users/lucasem/my_image.png" target="_blank"><img src="file:///Users/lucasem/my_image.png" alt="my_image" title="my_image" style="max-width:100%;"></a></p>

I just sent a support request to GitHub about it. Thanks for pointing this out!

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

2 participants