Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-15-2013, 09:00 PM   #46
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by DiapDealer View Post
So far as I understand, the DOCTYPE is not a requirement of the ePub spec.
This is only correct if the file does not use named entities. The doctype is required because it specifies the dtd that defines the entities. This isn't part of the epub spec because it's part of how HTML works.

This in itself is a major issue with HTML5. Since it doesn't define a doctype (not required by the spec) you can't use named entities. In the case of HTML5 a set of named entities is required to be supported (the same entities required by XML). Other entities not being defined will cause issues.

Basically, if you use named entities (other than the ones supported by XML) you must have them declared. They're typically declared via the doctype. Hence the need in this case for a fully valid doctype for the nbsp in the file to parse correctly.
user_none is offline   Reply With Quote
Old 08-15-2013, 10:11 PM   #47
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by user_none View Post
This is only correct if the file does not use named entities.
That's sort of my point. Bob's test ePub didn't use any named entities (with the exception of the & amp; which is supported), only the unicode non-breaking space character. So since the ePub didn't contain any unsupported entities, the DOCTYPE should have been unnecessary. The file really only needed the DOCTYPE after Sigil changed the unicode characters to named entities upon opening (to avoid Qt changing it to a normal space). That's the part that feels a bit wonky to me. Not that I know how else it could be handled to preserve the intent of the non-breaking space character when cleaning is turned off, mind you.
DiapDealer is online now   Reply With Quote
Advert
Old 08-16-2013, 01:57 AM   #48
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@user_none: I'm assuming there's some reason you cant just use numeric entities?
kovidgoyal is offline   Reply With Quote
Old 08-16-2013, 04:59 AM   #49
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
The nbsp named entity was used as it was commonly known and consistent, and, well, it didn't seem to be an issue.

If in the code we change conversion of the character to the numeric entity instead of nbsp named entity when loading the file then we also need to change the code that converts the character to the nbsp entity when you switch back from Book View (otherwise you'll just get an error if you have no DOCTYPE defined). This should work.

But now anyone who was using a DOCTYPE and nbsp entities could have some of those nbsp entities turned into numeric entities (e.g. on pages they edit in Book View) leaving a mix of named and numeric entities. Alternatively we change all nbsp entities into their numeric form everywhere in the code (loading, empty paragraphs, insert special character, etc.). That might affect quite a few find&replace statements and quite a few people so if such a change were made it would probably wait until a major release.
meme is offline   Reply With Quote
Old 08-16-2013, 11:03 PM   #50
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by kovidgoyal View Post
@user_none: I'm assuming there's some reason you cant just use numeric entities?
Constancy and expectations mostly. Other characters are auto converted to entities (not just non-breaking spaces) and named entities are used for those. Also, people know what nbsp does while many people don't know what #160 is.
user_none is offline   Reply With Quote
Advert
Old 08-16-2013, 11:42 PM   #51
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Another idea, replace the nbsp with
Code:
<span style="white-space:pre"> </span>
A little more semantic, though much longer.
kovidgoyal is offline   Reply With Quote
Old 08-17-2013, 03:47 AM   #52
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by kovidgoyal View Post
Another idea, replace the nbsp with
Code:
<span style="white-space:pre"> </span>
A little more semantic, though much longer.
As you probably know, French make a really extensive use of nbsp. This is part of their typographic rules. Personally I would not care if it was written in code view in a numeric (#160) or lettered (nbsp) form but I would certainly never follow your proposal, even if the end result was visually about the same in book view.

The proposed code above is way too long and awkward. We use regex to insert nbsp or their numeric equivalents, and I am pretty sure none (pun not intended) in France would ever consider this.

Last edited by roger64; 08-17-2013 at 04:52 AM.
roger64 is offline   Reply With Quote
Old 08-17-2013, 08:56 AM   #53
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
There is a reason for named entities: they are easy to remember (at least the common ones). No lookup chart needed. With number only

Is this (HTML5) number only requirement a result of the mindset of those who make frequent use WEB authoring tools?
theducks is offline   Reply With Quote
Old 08-17-2013, 09:31 AM   #54
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
HTML 5 works fine with named entities in all browsers/readers. Technically, the XHTML variant of HTML 5 is not valid without a DTD in the presence of named entities. However, the only things that actually dont work with named entities are the various pointless validity checking tools like epubcheck.
kovidgoyal is offline   Reply With Quote
Old 08-17-2013, 10:14 AM   #55
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by kovidgoyal View Post
HTML 5 works fine with named entities in all browsers/readers. Technically, the XHTML variant of HTML 5 is not valid without a DTD in the presence of named entities. However, the only things that actually dont work with named entities are the various pointless validity checking tools like epubcheck.
Thanks for setting me straight
theducks is offline   Reply With Quote
Old 08-17-2013, 05:17 PM   #56
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by kovidgoyal View Post
HTML 5 works fine with named entities in all browsers/readers. Technically, the XHTML variant of HTML 5 is not valid without a DTD in the presence of named entities. However, the only things that actually dont work with named entities are the various pointless validity checking tools like epubcheck.
Kovid:

Well, they may be pointless, but some of us are seriously stuck with them. I have to suffer through Lulu's epubcheck 1.x or some crap like that (which constantly rejects the DC "Creator," in case anyone here has a client going that route), and almost every variant along the way since then, depending on which distributor goes to which retailer and how "tecchy" their staffs are. Add this to Smashword's latest boggles (which I don't understand, don't they use your API?) and it's enough to make any real bookmaker weep. Do we all need ePUBcheck? Yes, for myriad reasons, but still....however pointless you find them, many of us can't ignore them.

H
Hitch is offline   Reply With Quote
Old 08-17-2013, 08:10 PM   #57
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by kovidgoyal View Post
HTML 5 works fine with named entities in all browsers/readers.
That hasn't been my experience doing cross browser web development. I've gotten older versions of Firefox and IE to fall over using named entities with HTML5 pages. While I should work it doesn't in practice.

I've changed to using numeric entities for nbsp in Sigil so the issue won't exist in the next release.
user_none is offline   Reply With Quote
Old 08-17-2013, 11:15 PM   #58
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Hitch: I am well aware of the idiocy of the various epub retailers that insist on using epubcheck. I keep getting bug reports about it, after all. The fact that retailers have blindly jumped on the epubcheck bandwagon does not change the fact of it's pointlessness.

@user_none: Really, you have html files with named entities that work in HTML 4 that dont work when you add an HTML 5 doctype? I would be very interested in seeing an example.
kovidgoyal is offline   Reply With Quote
Old 08-19-2013, 05:07 AM   #59
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by kovidgoyal View Post
@Hitch: I am well aware of the idiocy of the various epub retailers that insist on using epubcheck. I keep getting bug reports about it, after all. The fact that retailers have blindly jumped on the epubcheck bandwagon does not change the fact of it's pointlessness.
I'd be the first to agree. Nonetheless, I'm bloody stuck with it. I wish it were not so, but 'tis. ;-)

Hitch
Hitch is offline   Reply With Quote
Old 09-11-2013, 09:45 PM   #60
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
Quote:
Originally Posted by user_none View Post
The nbsp error is because your file is invalid. That prevents the file from being automatically cleaned (and many issues corrected) which is why you're seeing the other errors.
Is there a way to get Sigil to behave as it did in 0.72, maybe as an option?

On some older files, I get errors with regard to nbsp, image links, stylesheet links, and sometimes other links, where 0.72 just happily opened the file, saved it, and it worked everywhere; ADE, Calibre, and on my reader.

Basically, almost every file I open has errors, especially if they are converted to EPUB by Calibre. Often even books that are bought as EPUB's have (many) errors. (I mostly open them to remove whitespace between paragraphs and make indents smaller before sticking them into Calibre.)

If there really are errors that Sigil can fix reliably, such as missing doc-types, would it be possible to suppress the error messages and just fix the files silently; maybe add something like [Fixed] behind the file name in the address bar, to mark that it was fixed?

Last edited by Katsunami; 09-11-2013 at 09:50 PM.
Katsunami is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil 0.7.2 Released user_none Sigil 40 06-24-2013 11:35 PM
Sigil 0.7.1 Released user_none Sigil 64 03-26-2013 10:02 PM
Sigil 0.6.0 Released user_none Sigil 93 11-24-2012 06:50 PM
Sigil 0.5.3 Released user_none Sigil 85 05-13-2012 05:29 AM
Sigil 0.4.2 Released user_none Sigil 41 10-26-2011 06:03 AM


All times are GMT -4. The time now is 09:20 PM.


MobileRead.com is a privately owned, operated and funded community.