mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 13:54:54 +00:00
Images with Spaces #160
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RickStrahl on GitHub (Nov 10, 2017).
When embedding image urls with spaces the images are not parsed and the raw markdown is embedded:
Looks like other parsers are split on handling this - some work some don't:
https://babelmark.github.io/?text=This+doesn%27t+work+(doesn%27t+parse+just+embeds+the+markdown)%3A%0A!%5B%5D(Markdown+Monster.png)%0A%0AThis+works%3A%0A!%5B%5D(Markdown%2520Monster.png)%0A%0AThis+works%3A%0A%3Cimg+src%3D%22Markdown+Monster.png%22+%2F%3E
@xoofx commented on GitHub (Nov 10, 2017):
Yes, that's part of the CommonMark spec (link destination)
@RickStrahl commented on GitHub (Nov 11, 2017):
Thanks for clarifying.
Still think this would be a nice thing to have work (and other parsers including PanDoc are putting it in), particularly because the underlying HTML supports it.
Understand sticking to the spec though :-(
FWIW, I can fix this on my end when images get embedded which is easy enough - just looks ugly. OTOH, if people decide to put spaces in their asset paths they deserve what they sow :-)
@xoofx commented on GitHub (Nov 11, 2017):
It is only the browsers that support them, but the HTML specs (i.e. with the underlying RFC for URI) actually don't allow spaces. CommonMark allow also to specify a title attribute separated by a space right after the url like
[This is an example](http://example.com/ "Title Example")which would fight against what you are looking for.Moreover when you look at GitHub that is migrating to CommonMark, or in the .NET world, docfx also going to CommonMark, that's really not a good idea to encourage to replicate the legacy inconsistencies of browser behaviors.
@RickStrahl commented on GitHub (Nov 15, 2017):
Fair enough. Thanks Alexandre.