readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
222 stars 96 forks source link

Improve URL equality #453

Closed mickael-menu closed 3 weeks ago

mickael-menu commented 3 weeks ago

Instead of comparing URL to their string representation, compare their components with different rules:

The reason for this change is that some EPUBs encode unreserved characters which breaks locating a Link from an HREF.

For example both of these are valid relative URLs which point to the same resource: