03-30-2017, 06:01 PM | #1 |
Member
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. |
03-30-2017, 06:33 PM | #2 |
Well trained by Cats
Posts: 30,396
Karma: 58053698
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) |
Advert | |
|
03-30-2017, 06:45 PM | #3 |
Wizard
Posts: 1,613
Karma: 6718541
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.
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>, ...). |
03-31-2017, 03:53 AM | #4 |
Member
Posts: 12
Karma: 10
Join Date: Feb 2017
Device: kindle
|
Thanks guys!
|
Thread Tools | Search this Thread |
|
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 |