OmerFlame / SwiftRant

devRant API library made in Swift.
GNU General Public License v3.0
3 stars 1 forks source link

Fix for the `Link.calculatedRange` issue #34

Closed OmerFlame closed 1 year ago

OmerFlame commented 1 year ago

This is a fix for #28.

The issue was that if you have multiple links with the same shortened versions, the calculator would always pick the first link with the specified shortened version.

This new and improved version directly converts the original byte ranges retrieved from the ranges and converts them to a working character-based NSRange and thus generate a fully working and functional link range.

OmerFlame commented 1 year ago

@WilhelmOks Please review the changes, this is a pretty substantial improvement and it's also quite important.

WilhelmOks commented 1 year ago

I will have time tomorrow