SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
538 stars 42 forks source link

Fix GitHub local-document anchors #3309

Closed daveverwer closed 3 weeks ago

daveverwer commented 3 weeks ago

Fixes #3300

This did turn out to be caused by GitHub changing their markup. They add user-content- to every local anchor destination so that it doesn't clash with anything on their page, but they do not fix up the source anchors in their API call, only in their own web version. We were processing these already, but it looks like GitHub is no longer correcting the case, so we now need to do that as well. This fixes that.

Also, We were doing this README pre-processing in JavaScript and other pre-processing in Swift, so I've moved it all to Swift. We do still need one bit of JavaScript for it to work, but we're much more consistent with where we deal with these issues now.