Closed psic4t closed 11 months ago
How can I strip all tags, but retain the URLs?
I like to turn<a href="https://some.site">Some site</a> to http://some.site
<a href="https://some.site">Some site</a>
http://some.site
that isn't what this library is for, but you can use https://pkg.go.dev/golang.org/x/net/html to achieve this as you'll want to enumerate all tokens, only act on A elements and read just the href attribute.
A
href
How can I strip all tags, but retain the URLs?
I like to turn
<a href="https://some.site">Some site</a>
tohttp://some.site