![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2018
Location: Dallas, TX
Device: iBooks
|
Problems with eBooks from Apple Pages 7.1
The new version of Apple's Pages exports ePub files with this in the header:
Code:
<script src="../Misc/book.js"></script> Code:
<body dir="ltr" onload="Body_onLoad()"><div class="body" style="white-space:pre-wrap; line-break:strict;"><h1 class="p21" style=""> |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,660
Karma: 23468399
Join Date: Dec 2010
Device: Kindle PW2
|
I don't have a Mac, but I was able to reproduce the problem with an epub file generated by Pages for iOS 4.1. (The source was Kovid Goyal's docx test file.)
Apparently Pages adds an onload Javascript attribute to all <body> tags. A typical HTML file looks like this: Spoiler:
After selecting Mend & Prettify Code, it looks like this: Spoiler:
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,305
Karma: 5568878
Join Date: Nov 2009
Device: many
|
Self closing script tags are the issue which was fixed earlier in master (at least I thought it was). Are you testing with current master?
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,305
Karma: 5568878
Join Date: Nov 2009
Device: many
|
Under html5, a self-closing script tag is illegal and causes an error in head which invalidates the remainder of the document according to the rules for parsing html5 in browsers.
Under xhtml, it may be allowed but is really a bad choice especially for WebKit based browsers and browser based ePub readers, just like self-closing title tags for example. I can special case it if need be in mend if not already fixed. |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,175
Karma: 201721072
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I really wishes Pages would get rid of that "whitespace: pre-wrap" and "line-break: strict" crap while they're at it. It does nothing but cause problems whenever sensible line-breaks are added to their one-giant-line-with-no-line-breaks html chapters. All it accomplishes is making sure that the epub can't be properly edited with any external tools/editors without first removing that stuff.
Last edited by DiapDealer; 07-07-2018 at 05:14 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,660
Karma: 23468399
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Speaking of fixes, you've fixed lots of bugs since the 0.9.9 release. How about an interim bugfix release? Last edited by Doitsu; 07-07-2018 at 04:47 PM. |
|
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,175
Karma: 201721072
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#8 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2018
Location: Dallas, TX
Device: iBooks
|
Quote:
Thanks to Doitsu for helping elaborate on the problem. It was quite a shock when I first opened an ePub file from the new version and I didn't see any reports from anyone else yet. Nice explanation of the situation here: Why don't self-closing script tags work? If self-closing script tags are illegal and/or not recommended, should someone open a ticket with Apple to have them change that? |
|
![]() |
![]() |
![]() |
#9 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,305
Karma: 5568878
Join Date: Nov 2009
Device: many
|
Technically under rules of xhtml any tag can be self-closing but since there is no xhtml5 spec, and since the wording for the how html5 is supported under xhtml parsing rules in epub3s is not clearly specified, it seems a legal but strange decision by Apple to use it. Also given how many webkit derived browsers exist and support epub3 e-readers use them, it really makes no sense in my humble opinion to ever produce epub code that can not be clearly interpreted in all settings.
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Jul 2018
Location: Dallas, TX
Device: iBooks
|
This is a new feature for them in Pages, and I believe they may have put it in that way as a mistake, like many of us have done on our own pages.
|
![]() |
![]() |
![]() |
Tags |
javascript |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Does Sigil have problems with Pages 5? | rosshalde | Sigil | 6 | 10-29-2014 01:02 PM |
Apple granted patent for turning ebook pages | Arbait | News | 1 | 11-19-2012 11:55 AM |
Apple pages Creating Page breaks | ralphiedee | ePub | 4 | 05-30-2012 10:29 AM |
Count Pages Problems | GQ Man | Calibre | 8 | 10-29-2011 11:53 PM |
Apple: Creating ePub files with Pages | kjk | Apple Devices | 1 | 08-26-2010 06:46 PM |