jonathanyeung / mark-sharp

Mark Sharp WYSIWYG Markdown Editor for VS Code
36 stars 0 forks source link

Angle brackets syntax not supported #12

Closed dnabb-drake closed 2 months ago

dnabb-drake commented 3 months ago

Describe the bug When pointing to URLs which include whitespaces, it should be possible to enclose the URL in angle brackets. See commonmark example 485 and 488.

Mark Sharp seems to include the brackets in the link instead (effectively breaking the link).

To Reproduce Create two files, one with a whitespace in the filename and one without. Use the angle brackets syntax to link to them like this:

![Filename with a space](<2024-05-23---mark-sharp image.png>)

![Filename without space](2024-05-23---mark-sharp_image.png)

![Filename without space, but with angle brackets](<2024-05-23---mark-sharp_image.png>)

[Some Caption with angle brackets](<https://www.google.com/search?q=how to have spaces in markdown link>)

Expected behavior Angle brackets should be parsed appropriately, like VSCode built-in markdown preview does.

Screenshots image

Platform (please complete the following information):

jonathanyeung commented 3 months ago

Hi @dnabb-drake - thanks for the support and for filing this issue :) - getting more compliant with the CommonMark and GFM specs is a continual goal for this project. I've added this to the backlog.

jonathanyeung commented 3 months ago

Hi @dnabb-drake - the behavior around links should be improved in version 1.3.0, which was just released. Angled brackets in links and images should now resolve properly without including the '<' and '>' as part of the paths.

There's still some more work to be done before links completely follow the CommonMark Spec - namely, link title syntax is not yet supported.

If you encounter any issues while using angled bracket syntax in >= 1.3.0, let me know. Thank you!

jonathanyeung commented 2 months ago

I'm going to go ahead and close this issue. The fix should be in all versions >= 1.3.0. If you're still encountering this problem, please reopen. Thanks for filing!