gomarkdown / markdown

markdown parser and HTML renderer for Go
Other
1.37k stars 172 forks source link

Export `valid.IsSafeURL` #254

Closed onionltd closed 2 years ago

onionltd commented 2 years ago

If one wants to override safe URL matching function while still keeping the library's defaults, it can't do so without reimplementing entirety of the valid package. It would be useful to have the default function exported so other projects can wrap it in their override function in the same fashion how it is done in the tests.

https://github.com/gomarkdown/markdown/blob/dcdaee8e7a53b18f7880b9ed568c84ffc59500ca/helpers_test.go#L119-L131

I'm opening the issue to discuss because I have no intuition about how to complete the task in a way that will be accepted.