MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Editor (https://www.mobileread.com/forums/forumdisplay.php?f=262)
-   -   "Error while parsing file 'element "img" not allowed here" (https://www.mobileread.com/forums/showthread.php?t=285022)

shotsfromthebar 03-30-2017 07:01 PM

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

theducks 03-30-2017 07:33 PM

<img> must be inside one of those (block level) tags listed in the message.

It can't be 'naked' (stand alone)

dwig 03-30-2017 07:45 PM

What theducks said is the answer.

Quote:

Originally Posted by shotsfromthebar (Post 3498741)
... 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>, ...).

shotsfromthebar 03-31-2017 04:53 AM

Thanks guys!


All times are GMT -4. The time now is 10:54 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.