View Single Post
Old 07-23-2018, 08:10 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,665
Karma: 169712392
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by degn View Post
Hello forum

Im using the code ⁄ to generate a fraction with HTML in Calibre, its working fine in the preview mode (picture 2) but not the final EPUB-file. The code is (picture 1):

Code:
<p class="rightalm"><span style="font-size:70%;"><sup>7</sup>&frasl;<sub>3</sub></span> 1911.</p>
I get this error:

“This page contains the following errors: error on line 88 at column 69: Entity 'frasl' not defined Below is a rendering of the page up to the first error.” (picture 3)

Any idea what is wrong? and how to solve the problem so I can display the fraction symbol?

Regards Dan
What happens when you replace &frasl; with "& # 8260;" <remove the spaces>? AFAIR, the calibre editor removes the DOCTYPE declaration which is needed to use named entities in epub2 documents. With epub3 removing most named entities, I've gotten used to using numeric entities instead though they are a PITA since named entities are just so much easier to read. I seem to remember from a discussion 4 or so years ago, that the calibre editor would translate named entities to numeric or the actual character while stripping the DOCTYPE declaration but as I said, years back and I may be misremembering.

Using Sigil as the editor, if I remove the DOCTYPE declaration, I get the following error from epubcheck:

Code:
Col: 69: FATAL(RSC-016): Fatal Error while parsing file 'The entity "frasl" was referenced, but not declared.'.
whereas when I restore the DOCTYPE declaration, I get "No problems found!".

Just in case, what I am referring to as the DOCTYPE declaration follows after the ?xml line.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

Last edited by DNSB; 07-23-2018 at 08:24 PM. Reason: fat fingered typos strike again! More at 11!
DNSB is offline   Reply With Quote