MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Conversion (https://www.mobileread.com/forums/forumdisplay.php?f=235)
-   -   Allow / inside fragment identifier (https://www.mobileread.com/forums/showthread.php?t=255833)

iliakan 02-11-2015 09:03 AM

Allow / inside fragment identifier
 
From http://tools.ietf.org/html/rfc3986:
Quote:

The characters slash ("/") and question mark ("?") are allowed to
represent data within the fragment identifier.
Ebook conversion filters fragment identifiers in a too harsh way: https://github.com/kovidgoyal/calibr...t.py#L350-L359

Code:

frag_pat = re.compile(r'[-A-Za-z0-9_:.]+$')

I'd suggest to add / and maybe ? to the list, because the standard explicitly allows that.

The issue breaks conversion for certains HTMLs.

kovidgoyal 02-11-2015 09:12 AM

That section is there to workaround limitations in Adobe Digital Editions, which tends to fall over and die with fragment identifiers that contain characters other than those in the regex, as is noted in the comment.

Not to mention that the cleanup is performed for fragment identifiers in the NCX ToC, for which the HTML spec is irrelevant.


All times are GMT -4. The time now is 10:55 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.