Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-17-2023, 01:40 AM   #1
RobertWK
Junior Member
RobertWK began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2022
Device: none
40+ Errors from epubcheck telling me that element "figure" not allowed here

Hi!

I am working on hopefully the last stages of this ebook, and I'm getting an issue where epubcheck 5.0.1 is telling me that

Code:
ERROR(RSC-005): ... /Chapter2.html(72,315): Error while parsing file: element "figure" not allowed here;
I tried changing the extension of one chapter from xhtml to html and back and that made no difference.

Is it because I'm using <!DOCTYPE html> that it's not working? Part of the error is saying with xmlns:ns1="http://www.w3.org/1998/Math/MathML" xmlns:ns2="http://www.w3.org/2000/svg"... do I need to specify another xmlns?

Unfortunately the enshittification of google isn't helping me dig up any clues and I'm at a little bit of a loss.
RobertWK is offline   Reply With Quote
Old 05-17-2023, 02:11 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,104
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Best to post the <figure> code from Chapter2.html so we can get an idea how it is used.
Better would be to copy and paste the entire page, preferably to a paste site and provide the link.

Last edited by Karellen; 05-17-2023 at 02:26 AM.
Karellen is offline   Reply With Quote
Old 05-17-2023, 02:28 AM   #3
RobertWK
Junior Member
RobertWK began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2022
Device: none
It looks like this:

Code:
<div style="text-indent:0;text-align:center;margin-right:auto;margin-left:auto;width:99%;page-break-before:auto;page-break-inside:avoid;page-break-after:auto;">
<div style="margin-left:0;margin-right:0;text-align:center;text-indent:0;width:100%;">
<p style="display:inline-block;text-indent:0;width:100%;">
   <figure>
   <img alt="Some text" src="IMG_9963.jpg" style="width:99%;"/> 
   <figcaption>
   <i class="calibre1">Some text</i>
   </figcaption>
   </figure>
</p>
</div>
</div>
I only changed the text and added line breaks for readability.

Pretty much everywhere where I'm using a figure looks like this with only derivation of the text and file names.

Last edited by RobertWK; 05-17-2023 at 02:31 AM. Reason: minor description of issues.
RobertWK is offline   Reply With Quote
Old 05-17-2023, 03:10 AM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,104
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
You have the <figure> elements nested inside <p> tags.

Remove the <p> tags and it should be fine.
Some info... https://developer.mozilla.org/en-US/...Element/figure

The coding doesn't seem to be the best. Heavy reliance on in-line attributes which would be better off in your css page.
Karellen is offline   Reply With Quote
Old 05-17-2023, 03:13 AM   #5
RobertWK
Junior Member
RobertWK began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2022
Device: none
Quote:
Originally Posted by Karellen View Post
You have the <figure> elements nested inside <p> tags.

Remove the <p> tags and it should be fine.
Some info... https://developer.mozilla.org/en-US/...Element/figure

The coding doesn't seem to be the best. Heavy reliance on in-line attributes which would be better off in your css page.
It's true--I never claimed to be a great html script writer. For most other things I've written CSS for but I just don't have a lot of depth of knowledge to manage it all. This is the only major issue that I'm struggling with validation on, so once I fix it I'll be mostly done.
RobertWK is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Error while parsing file 'element "img" not allowed here" shotsfromthebar Editor 3 03-31-2017 03:53 AM
epubcheck: attribute "page-map" not allowed here error message Bala_85 ePub 2 07-14-2013 03:13 AM
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
epubcheck: attribute "page-map" not allowed here error message Doitsu ePub 5 10-27-2011 08:51 PM


All times are GMT -4. The time now is 03:13 AM.


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