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

Badges that reference SVG files from github in a markdown file don't work in devhub #127

Closed
patricksimonian opened this issue Nov 22, 2018 · 1 comment
Assignees
Labels

Comments

@patricksimonian
Copy link
Contributor

Describe the bug
I have a markdown file in a repository that has an image [image](../../something.svg)
It appears to work when i view the markdown file from Github, but in the Devhub the image is broken.

What it looks like
screen shot 2018-11-22 at 10 43 19 am
What it should look like
screen shot 2018-11-22 at 10 43 39 am

Desktop (please complete the following information):

  • OS: Any
  • Browser Any

Smartphone (please complete the following information):

  • Device: Any
  • OS: Any
  • Browser Any
@patricksimonian
Copy link
Contributor Author

The Issue

So it looks like this issue has to do with a Github Markdown Issue

TL;DR

It appears there are two reasons why externally referenced SVG files don't work in the Devhub.

  1. Image Tags that source SVG's won't load by default (as explained in the above issue)

'Referencing an SVG using an tag rasterizes the image and prevents it from further loading anything. It's basically inert.'

  1. Github itself prevents external requests to its svg resources
  • this was tested by using one of many work around for externally loaded SVG's <object data='...'>, <embed ...>`

Work Around

If you are trying to load an SVG Image, perhaps provide a PNG conversion of that and reference that in your markdown instead.

If you are trying to use a Badge as mentioned in the example screen shots. Using the shields.io API is a great alternative that will work in your markdown files as is as well as the Devhub :)

The above badge (in the screenshot) could therefor be replaced with
![Status: Draft](https://img.shields.io/badge/Status-Draft-blue.svg)
Status: Draft

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

No branches or pull requests

1 participant