gomarkdown / markdown

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

Move shared functions in a common internal package #251

Closed onionltd closed 2 years ago

onionltd commented 2 years ago

This series of commits moves the same unexported functions defined across different packages in internal/utils and adds unit tests. I admit that the naming is lazy and am willing to rename if someone comes with a better name.

I noticed the imports are also affected, which I reckon is due to me using a different tool for auto-formatting (gofmt).

miekg commented 2 years ago

I would create a 'textutil' and an 'astutil' package and move the IsList and friends to the astutil one

kjk commented 2 years ago

It was probably me who wrote the comment about using internal package but looking at the change: it's more code for no benefit.

onionltd commented 2 years ago

I was preparing the ground for a different approach to tackle #241. I should've mentioned that in the description. Here's the diff of the branch with the whole thing: https://github.com/gomarkdown/markdown/compare/master...onionltd:markdown:override-is-safe-url?expand=1