FB2 conversion creates invalid html

Bug #1752141 reported by Silvara on 2018-02-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

Converting FB2 to EPUB creates invalid html for the `poem` element: it creates a `blockquote` which contains text. Blockquotes cannot contain text.

Silvara (mistresssilvara) wrote :

text is perfectly valid inside blockquote in the HTML 5 spec, and I know
of no actual HTML renderers that have trouble with text inside
blockquote.

https://dev.w3.org/html5/spec-preview/the-blockquote-element.html

(content model is flow content and text is flow content)

So what actual problem are you having? Complaints from the useless
epubcheck?

 status invalid

Changed in calibre:
status: New → Invalid
Changed in calibre:
status: Invalid → New
Silvara (mistresssilvara) wrote :

EPUB2 books do not use html5. They use XHTML. In XHTML, blockquotes contain block elements only.

The problem is invalid XML documents Calibre generates in that case, as they do not conform to the scheme.

Kovid Goyal (kovid) wrote :

Yes, and conforming to the schema is utterly pointless since not conforming to it has no actual real world consequences and will have no real world consequences, ever. https://manual.calibre-ebook.com/faq.html#the-epub-i-produced-with-calibre-is-not-valid

Once again, do you know of a single EPUB 2 renderer that actually fails to render text inside blockquotes, if so feel free to re-open, otherwise stop wasting my time.

Changed in calibre:
status: New → Invalid
Eli Schwartz (eschwartz) wrote :

Also as the FAQ pointed out, if you actually want valid XHTML you need to start with valid XHTML, which I am pretty sure FB2 does not qualify as...

Kovid Goyal (kovid) wrote :

That said, in this case there is no harm in adding <div> wrappers, if
for no reason other than to silence the useless epubcheck, so https://github.com/kovidgoyal/calibre/commit/c9f56651ba8f4b405b716dd1a3bfa3809546e3b1

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments