Vivify-Ideas / vue-simple-markdown

A Simple and Highspeed Markdown Parser for Vue
MIT License
83 stars 17 forks source link

Images are not rendering #34

Open Vinayak-k160 opened 4 years ago

Vinayak-k160 commented 4 years ago

How to render images its is showing link for image but not image

Vinayak-k160 commented 4 years ago

hey please note I used this link "https://images.unsplash.com/photo-1555099962-4199c345e5dd?ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80" for image and it used to return me Link instead of Image. So actually there was error in Image Regex it does not contain & char so I corrected the Regex as below "/![(.*)](((?:(http[s]?|ftp)?:?\/{0,2})[\w\/-+?#&=.:]+))/g" hope you will fix the bug

arnoclr commented 3 years ago

Also note that some links contain %, like firebase storage urls.

This regex work fine, based on yours :

/![(.*)](((?:(http[s]?|ftp)?:?/{0,2})[\w/-+?#&%=.:]+))/g