miaolz123 / vue-markdown

A Powerful and Highspeed Markdown Parser for Vue
https://miaolz123.github.io/vue-markdown/
MIT License
1.89k stars 257 forks source link

Need to set baseurl for all images #88

Open soichih opened 5 years ago

soichih commented 5 years ago

I am using this component to render README.md content stored on github (for example, https://github.com/soichih/app-AFQ_figures)

If there is any images referenced on the README.md like this.

![screenshot](screenshot.png)

Although this is rendered properly on github, the vue-markdown renderes this on our website with the following URL.

<img src="screenshot.png" alt="screenshot">

Since there is no "screenshot.png" stored under our domain name, this will result in a broken image. The URL "screenshot.png" needs to be prefixed by something like "https://github.com/soichih/app-AFQ_figures/raw/master/" so that the image will be displayed correctly inside our website.

Is there anyway to specify the "baseurl" of all resources referenced within vue-markdown? Like...

<vue-markdown 
    :source="readme" 
    baseurl="https://github.com/soichih/app-AFQ_figures/raw/master/">
</vue-markdown>

?