Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 09:12 AM   #1
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 365
Karma: 518
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
<u> fails EpubCheck

I just had a failure on EpubCheck (5.3.0) due to some underlined text marked up with the <u> </u> tags in an epub2 file.

Code:
Col: 38: ERROR(RSC-005): Error while parsing file: element "u" not allowed anywhere; expected the element end-tag, text or element "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
Epub3 passes same check ok.

Sigil still inserts these tags as formatting for underlining: in Format > Underline.

Has there been a change in epub spec?

Should Sigil add a warning not to use <u> in epub2 files?
philja is offline   Reply With Quote
Old Yesterday, 10:30 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,675
Karma: 6774048
Join Date: Nov 2009
Device: many
No, the u tag is valid. It was briefly dropped/deprecated before html5 but saner minds prevailed and it was kept.

If you prefer to use a different tag, then create and use a clip.

Quote:
Modern Semantic MeaningIn HTML5, the <u> tag is no longer just for visual styling. It is now formally known as the Unarticulated Annotation element. It should be used to mark text that:

Has a non-textual annotation: Common use cases include indicating misspelled words or proper name marks in Chinese text.

Is stylistically different: It offsets text from its surrounding content without conveying extra emphasis or importance.
It works in both epub2 (but deprecated) and epub3.

Perhaps you are using an older version of epubcheck? Or maybe epubcheck is holding to the XHtml 1.1 spec too literally.

Either way you can use a span with a class the does underlining and create your own clip if you want. Not sure how much longer support for epub2 will remain. Even the original spec is hard to find anymore!

Last edited by KevinH; Yesterday at 10:41 AM.
KevinH is offline   Reply With Quote
Advert
Old Yesterday, 10:54 AM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,675
Karma: 6774048
Join Date: Nov 2009
Device: many
I took a look at the Sigil 0.8 branch which was before any epub3 support was added to Sigil at all, and the code back at the height of epub2 used the u tag and epubcheck at the time and our own syntax checker Flightcrew (now retired) had no problems with it at all.

My guess is this is an epubcheck bug being overly literal with changes from Xhtml 1.0 to XHtml 1.1 when the u tag was deprecated but never removed.

Also not sure how maintained the epub2 specific code in epubcheck really is anymore? My guess is no one there really cares about epub2 anymore when they are resource constrained just trying to support epub3.

So maybe just bitrot?

So if newer epubcheck now objects to the u tag under epub2, and you are constantly editing epub2s, I would just use my own clip.

Last edited by KevinH; Yesterday at 11:01 AM.
KevinH is offline   Reply With Quote
Old Yesterday, 11:05 AM   #4
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 365
Karma: 518
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Perhaps you are using an older version of epubcheck? Or maybe epubcheck is holding to the XHtml 1.1 spec too literally.
I'm using the latest version of Doitsu's epubcheck plugin (0.4.7.1) and every time it runs, it announces that it's checking for a later version of EpubCheck and then says it's running 5.3.0.

I've never used the <u> tags for underlining - any time I've wanted to underline, I've used CSS, but on this occasion, a friend asked me to look at his epub2 book and the first thing I did was to run it thro the epubcheck plugin. The error message surprised me.

When I found that <u> provoked an error, I checked in an epub3 book and found that it passed in epub3.

Not a problem for me and probably of little interest to others since epub3 is gradually taking over.

Last edited by philja; Yesterday at 11:07 AM.
philja is offline   Reply With Quote
Old Yesterday, 11:26 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,675
Karma: 6774048
Join Date: Nov 2009
Device: many
According to the XHtml 1.1 schema, they removed b, i, u, and a few other tags because they felt they were purely styling, and so did not understand that semantically there are times for an underline to not mean anything specific (ie not a title, etc). This got immediately reversed in html5 as there were legitimate meaning for those tags.

So fwiw, you may run into similar issues with epub2 with b and i tag usage as well although they are more common and may have exceptions.

Did that epub2 by chance use a doctype that specified xhtml 1.0 or use the word transitional at all? Both would have allowed the u tag.

Last edited by KevinH; Yesterday at 11:29 AM.
KevinH is offline   Reply With Quote
Advert
Old Yesterday, 11:35 AM   #6
philja
Addict
philja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enoughphilja will become famous soon enough
 
Posts: 365
Karma: 518
Join Date: Nov 2015
Location: Europe EEC
Device: Kindle Fire HD6 & HD8
Quote:
Originally Posted by KevinH View Post
According to the XHtml 1.1 schema, they removed b, i, u, and a few other tags because they felt they were purely styling, and so did not understand that semantically there are times for an underline to not mean anything specific (ie not a title, etc). This got immediately reversed in html5 as there were legitimate meaning for those tags.

So fwiw, you may run into similar issues with epub2 with b and i tag usage as well although they are more common and may have exceptions.

Did that epub2 by chance use a doctype that specified xhtml 1.0 or use the word transitional at all? Both would have allowed the u tag.
No. Doctype is XHTML 1.1 and no mention of transitional. <i> and <b> don't provoke any errors from EpubCheck. What's more, the error message I quoted in the first post, shows that EpubCheck was looking for i and b , amongst other options (but definitely not u).

Last edited by philja; Yesterday at 11:37 AM.
philja is offline   Reply With Quote
Old Yesterday, 11:43 AM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,675
Karma: 6774048
Join Date: Nov 2009
Device: many
Thanks for that info. Even an old spec like epub2 keeps changing.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cover Image required by iTunes in the GUIDE, fails epubcheck 3 Oxford-eBooks ePub 5 12-09-2011 01:17 PM
Epub works fine on Reader, fails epubcheck spectacularly jmatthew ePub 3 01-05-2011 06:03 AM
Calibre epub works fine on Reader, fails epubcheck spectacularly jmatthew Calibre 2 01-04-2011 03:12 PM
epub date error fails epubcheck 1.05 dkata Calibre 2 09-13-2010 04:21 AM
Web-based epubcheck upgraded to epubcheck 1.0.5 kjk ePub 4 02-09-2010 09:53 PM


All times are GMT -4. The time now is 04:15 AM.


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