You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When EpubReader encounters an escaped URL in <ncx>/<navMap>/<navPoint>/<content>/src attribute in EPUB 2 NCX or <a>/href attribute in EPUB 3 navigation document, it converts it into an unescaped representation. However, this happens only at the second parsing stage when an instance of Epub2Ncx or Epub3NavDocument gets converted into a List<EpubNavigationItemRef>:
Applications using Epub2Ncx or Epub3NavDocument types directly have to unescape the URLs manually.
Proposed solution
Move URL unescaping into Epub2NcxReader and Epub3NavDocumentReader to make sure that instances of Epub2Ncx and Epub3NavDocument types contain unescaped URLs.
vers-one
changed the title
Unescape URLs from EPUB 2 NCX and EPUB 3 navigation documents
Unescape URLs in EPUB 2 NCX and EPUB 3 navigation documents
May 27, 2023
Description
When EpubReader encounters an escaped URL in
<ncx>/<navMap>/<navPoint>/<content>/src
attribute in EPUB 2 NCX or<a>/href
attribute in EPUB 3 navigation document, it converts it into an unescaped representation. However, this happens only at the second parsing stage when an instance ofEpub2Ncx
orEpub3NavDocument
gets converted into aList<EpubNavigationItemRef>
:EpubReader/Source/VersOne.Epub/Readers/NavigationReader.cs
Line 44 in 88d0cb0
EpubReader/Source/VersOne.Epub/Readers/NavigationReader.cs
Line 103 in 88d0cb0
Applications using
Epub2Ncx
orEpub3NavDocument
types directly have to unescape the URLs manually.Proposed solution
Move URL unescaping into
Epub2NcxReader
andEpub3NavDocumentReader
to make sure that instances ofEpub2Ncx
andEpub3NavDocument
types contain unescaped URLs.Additional context
RFC 2396 - URI Escape Sequences: https://www.rfc-editor.org/rfc/rfc2396#section-2.4
The text was updated successfully, but these errors were encountered: