randy3k / AutoWrap

Auto (Hard) Wrap for Sublime Text 2/3
MIT License
62 stars 8 forks source link

Inline markdown links are broken (in both senses) #21

Open detly opened 6 years ago

detly commented 6 years ago

If I have an inline markdown link such as [link text](https://github.com), and it's near the end of a line, I can end up with:

[link text]
(https://github.com)

This won't render as a link in most markdown renderers. I don't want to simply drop ( from the list of breaking characters, but I don't really know how you'd solve this without having per-syntax exceptions.

(This could be a bug in Wrap Plus too, which I'm also using. See their issue #57.)

detly commented 6 years ago

Oh, I don't think it's Wrap Plus, because they break it between link and text if I trigger it manually.

randy3k commented 6 years ago

You could edit the setting auto_wrap_break_patterns.

detly commented 6 years ago

I thought about that, but what would I do other than remove (? Maybe putting that in markdown specific settings would work, and any other occurrences of ( would likely be preceded by a space.

randy3k commented 6 years ago

Yes, you could put the following in markdown specific settings Markdown.sublime-settings.

{
    "auto_wrap_break_patterns" :  ["\\[", "(<=\\s)\\(", "\\{", " ", "\\n"]
}