Hi all,
I use a Node.js workflow to connect Github repository and Discourse through Discourse API.
Every time someone pushes .md file in a repository automatically Discourse topic is created using POST request https://{defaultHost}/posts.json or if the topic already exits - I just update it with PUT request https://{defaultHost}/posts/{id}.json.
I have a problem with the images - there is couple of ways to include image in Github .md file. The following are working fine and the images are uploaded to Discourse:
- if the image is hosted on https://user-images.githubusercontent.com/
- if the image is uploaded directly to the repo and you append a ?raw=true at the end of the image link
https://github.com/[username]/[reponame]/blob/[branch]/image.jpg?raw=true
but the following two are not working:
- if relative link is used
relative/path/to/img.jpg
- the ?raw=true part is missing
https://github.com/[username]/[reponame]/blob/[branch]/image.jpg
Is there a way to ensure that all the images from the .md file will be uploaded to Discourse?