![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: May 2019
Device: htc u11 android
|
epub validator question
I have a 600K HTML5 file with a very large TOC all validating under the W3C HTML validator but the EPUB validator finds errors in the conversion of this file into an EPUB file by Calibre.
The no 4 of the unzipped EPUB file is the first (repeated on every "a tag") to be found incorrect at line 11 by the EPUB validator and I have no idea what the problem could be. This split section of EPUB file in turn does not trigger any error on line no 11 by W3C HTML validator although it complained twice as expected about line no 1. The error code is: Error while parsing file: element "a" not allowed here; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg") And the converted HTML code is: 01 <?xml version='1.0' encoding='utf-8'?> 02 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr" xml:lang="en"> 03 <head> 04 <title>My Title Here.</title> 05 <meta name="description" content="My metadata here."/> 06 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 07 <link href="stylesheet.css" rel="stylesheet" type="text/css"/> 08 <link href="page_styles.css" rel="stylesheet" type="text/css"/> 09 </head> 10 <body class="calibre pcalibre"> 11 <a id="My_Link_Here" class="pcalibre"><h1 class="pcalibre h1nopba" id="calibre_pb_4">My Link Here<br class="pcalibre calibre3"/>Table Of Content</h1></a> 12 </body></html> Can anyone suggest what the error is? Thank you for your help. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
You'll need to wrap <a> tags in block level tags. For example:
<h1 class="pcalibre h1nopba" id="calibre_pb_4"><a id="My_Link_Here" class="pcalibre"></a>My Link Here<br class="pcalibre calibre3"/>Table Of Content</h1> |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
![]() But I question the need for an <a> at the top of any file (just after the <body> Jumping to that file should open at the top all by itself |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: May 2019
Device: htc u11 android
|
Thank you, that fixed it.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Epub:type not allowed in epub validator | wDr | Editor | 0 | 07-01-2016 09:03 PM |
Another EPUB validator? | crankypants | ePub | 6 | 06-24-2016 03:03 AM |
validate with W3C Validator question | Capricorn | ePub | 12 | 03-09-2016 03:25 PM |
Epub Validator | bimmy | ePub | 11 | 01-09-2014 07:21 AM |
epub validator | fiona86 | Conversion | 2 | 06-24-2011 11:34 AM |