telesoho / vscode-markdown-paste-image

Smartly paste for Markdown.
MIT License
135 stars 41 forks source link

Pasting "\" in file paths breaks Github markdown rendering #2

Closed crpietschmann closed 7 years ago

crpietschmann commented 7 years ago

When pasting an image in, it uses "\" backslash characters for the file path. This breaks the HTML rendering of the Markdown text in Github.

Broken:

![](folder\image.png)

Expected:

![](folder/image.png)

By correcting the tool to use forward slashes "/" in the image url it will fix the markdown to be compatible with Github.

A little more information about this bug: The reason paths can be broken if a backslash "\" is used is because certain web servers (like Github) are very strict with slashes. All URL paths need to use forward slashes "/" on Github and other server; primarily Linux servers. Windows servers are generally friendly to using either type of slash.

telesoho commented 7 years ago

Thank you for your help!