Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-30-2017, 06:01 PM   #1
shotsfromthebar
Member
shotsfromthebar began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2017
Device: kindle
"Error while parsing file 'element "img" not allowed here"

Hi guys,

I'm running my book through an epub validator and getting a bunch of the following errors:

ERROR Line: (XX) Position: (always 59 or 60)
Error while parsing file 'element "img" not allowed here; expected the element end-tag or 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")'.

I get an error for every image I have in the book. I've looked through the code, but it's not clear to me what I'm doing wrong... I'm inserting images into the code via Calibre's code editor "add image" button, pretty straightforward stuff, and I can't think of any reason why the <img> tag would cause issues...

I'm also having problems getting the book to work on Androids, and I wonder if these errors may be the cause, but that's a topic for another thread...

Thanks for any help offered in getting this cleared up.

Luke
edit: you can get my book for free at www.obliviousthebook.com and try it out for yourself if you want to understand the issues...

Last edited by shotsfromthebar; 03-30-2017 at 06:03 PM.
shotsfromthebar is offline   Reply With Quote
Old 03-30-2017, 06:33 PM   #2
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,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
<img> must be inside one of those (block level) tags listed in the message.

It can't be 'naked' (stand alone)
theducks is offline   Reply With Quote
Advert
Old 03-30-2017, 06:45 PM   #3
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
What theducks said is the answer.

Quote:
Originally Posted by shotsfromthebar View Post
... I'm inserting images into the code via Calibre's code editor "add image" button, pretty straightforward stuff, ...
The Add Image service in calibre' Editor does not police the placement of the resulting <img> tag. If the current cursor position is outside of any Block class elements then the tag will be left "naked" until you take some action to finish the job by wrapping it appropriately (e.g. between <p> & </p>, <div> & </div>, ...).
dwig is offline   Reply With Quote
Old 03-31-2017, 03:53 AM   #4
shotsfromthebar
Member
shotsfromthebar began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Feb 2017
Device: kindle
Thanks guys!
shotsfromthebar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub validation error help "attribute border is not declared for element img bmacklin ePub 12 11-06-2015 11:00 AM
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


All times are GMT -4. The time now is 06:14 PM.


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