Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-17-2014, 02:09 PM   #1
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
element "u" not allowed anywhere

Hi all

So I'm at the final stage of my epub-novel and ran a validation. I get this error message about a hundred times:

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")

From what I've read, the <u> shouldn't be a problem as long as it is within a <p>.
This is what it all looks like in my html:

Code:
<p><u>some text</u></p>
So, what exactly is the problem here? I used the calibre editor, and it has this toolbar with the "u", "b", "I" etc, so I just (ignorantly?)used it...

What should I do to fix this, and is there an easy way to fix all 100 instances at once? I've heared of regex, but I don't master it yet (not by a long shot). Any help would be grately appreciated, as always.

Yours

Johan
JLius is offline   Reply With Quote
Old 04-17-2014, 03:06 PM   #2
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
You can replace <u> with <span class="u"> even without regexpession and then do the same with </u> to </span> and then write a .u entry in CSS to perform the underlining.

Dale

Last edited by DaleDe; 04-17-2014 at 08:31 PM.
DaleDe is offline   Reply With Quote
Advert
Old 04-17-2014, 03:10 PM   #3
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
you could use the following regex to replace all instances, although i would recommend against blindly doing a global replace, better to go through one-by-one (more or less automated in Sigil with 'Search in all XHTML files' and then clicking 'Replace/Find Next').

Code:
find:
<u>(.*?)</u>

replace:

<span class="underline">\1</span>
then in your stylesheet you'd

Code:
.underline{
    text-decoration:underline;
}
if you are using Sigil, remember to make sure the regex search is selected in the find/replace bar
mzmm is offline   Reply With Quote
Old 04-17-2014, 03:20 PM   #4
skreutzer
Software Developer
skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.
 
skreutzer's Avatar
 
Posts: 190
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
As the error message clearly points out, you're not allowed to use <u> anywhere, since <u> is a deprecated element in HTML4 Strict and XHTML Strict. Does Calibre place an <u> in the EPUBs XHTML when clicking on an “underline” button?
skreutzer is offline   Reply With Quote
Old 04-17-2014, 03:45 PM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
It is one of those things which will work in actual readers, but which validators don't like. Not a problem if for personal use, but publishers will use one or another of them.

Underlining is very old school, as there are other ways to emphasize by bolding, italicizing, increasing the font size, etc. About the only use I could see for it these days would be to try to create a form to be filled out. But there are even better ways to do that. The main use would be to copy an original that used them.

One of the issues is that underlining can be confused with links, so that hastened its way out the door.
mrmikel is offline   Reply With Quote
Advert
Old 04-17-2014, 04:48 PM   #6
skreutzer
Software Developer
skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.
 
skreutzer's Avatar
 
Posts: 190
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
Rendering software should be quite tolerant regarding validity, processing tools should not be required to be overly tolerant to all kinds of non-standard data junk, and creation tools should absolutely follow a zero tolerance policy. The fact that underlining is bad typography is a separate issue besides technical correctness. Syntactical and semantical correctness are the bare minimum for 21st century web and e-book technology.

Last edited by skreutzer; 04-17-2014 at 04:53 PM.
skreutzer is offline   Reply With Quote
Old 04-18-2014, 02:01 AM   #7
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Quote:
Originally Posted by skreutzer View Post
As the error message clearly points out, you're not allowed to use <u> anywhere, since <u> is a deprecated element in HTML4 Strict and XHTML Strict. Does Calibre place an <u> in the EPUBs XHTML when clicking on an “underline” button?
Yes, the calibre editor has an underline button on the toolbar that places a <u> in your html file. Doesn't Kovid Goyal know that the <u> is a deprecated element? That would be weird, no? I really thought Goyal was omniscient

Thanks for the tips, I'll try and implement them this evening (European time ).
JLius is offline   Reply With Quote
Old 04-18-2014, 02:26 AM   #8
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
To be fair, <b> and <i> are also deprecated but no warnings will be given for those. Honestly I do not see them go away very soon either...
Toxaris is offline   Reply With Quote
Old 04-18-2014, 02:33 AM   #9
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Should I post on the editor forum that the editor toolbar has deprecated elements? Or do you think Goyal has a good reason to be still using them?
JLius is offline   Reply With Quote
Old 04-18-2014, 04:10 AM   #10
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Quote:
Originally Posted by JLius View Post
Should I post on the editor forum that the editor toolbar has deprecated elements? Or do you think Goyal has a good reason to be still using them?
Differences Between HTML 4.01 and HTML5
The <u> element was deprecated in HTML 4.01. (the <u> element was used to define underlined text).

The <u> element is redefined in HTML5, to represent text that should be stylistically different from normal text, such as misspelled words or proper nouns in Chinese.

Reference: http://www.w3schools.com/Tags/tag_u.asp
odedta is offline   Reply With Quote
Old 04-18-2014, 04:16 AM   #11
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Sure, but how does that answer my question? The toolbar in the editor uses the <u> element to underline text, not to write in Chinese.
JLius is offline   Reply With Quote
Old 04-18-2014, 05:22 AM   #12
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
It's an element you can use, you can always define it's style in your stylesheet.

In a couple of hours when I'm back home I'll check this thoroughly.
odedta is offline   Reply With Quote
Old 04-18-2014, 05:36 AM   #13
skreutzer
Software Developer
skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.skreutzer considers 'yay' to be a thoroughly cromulent word.
 
skreutzer's Avatar
 
Posts: 190
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
No, you can't (in EPUB at least):

http://www.idpf.org/epub/20/spec/OPS...htm#Section2.2

Since it was already deprecated, I guess they just threw it out in order to define a more futuristic use of HTML elements.
skreutzer is offline   Reply With Quote
Old 04-18-2014, 05:45 AM   #14
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
I posted it on the editor forum, maybe Goyal has an explanation.

https://www.mobileread.com/forums/sho...09#post2812109
JLius is offline   Reply With Quote
Old 04-18-2014, 07:17 AM   #15
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
And he did. I should just ignore the errors, epub validation is a waste of time.

Cheers y'all!
JLius is offline   Reply With Quote
Reply

Tags
validation error


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The element type "p" must be terminated by the matching end-tag "</p>". uieluck ePub 10 02-12-2013 07:04 PM
element "img" not allowed in this context graniton Calibre 5 05-14-2012 11:39 PM
ePub validation error: 'element "span" not allowed here' nannygoats ePub 5 11-30-2011 08:47 AM
element "span" not allowed in this context jihwan Calibre 4 07-17-2010 09:25 PM
Crash on nonexistent "title" metadata element Valloric EPUBReader 3 12-10-2009 01:46 PM


All times are GMT -4. The time now is 05:33 PM.


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