kobolabs / epub-spec

Details on the elements of the ePub spec that Kobo supports, as well as other information on the Kobo reading platforms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are HTML comments required for switch markup?

dkurth opened this issue · comments

In the "Fallback Statements/Switches" section, HTML comment tags are placed around the epub:switch markup, leaving only the default case uncommented.

Is that markup required for certain legacy Kobo reading systems? If so, do you know which reading systems require it? Thanks!

My concern about this is that the use of comments around the switch element is not defined in the EPUB 3 spec, and using comments in the manner shown could potentially cause problems displaying switch content in other EPUB 3 reading systems because it is a non-standard implementation. I know Kobo is not required to think about how other reading system creators will support or not support the comments, but it could lead to frustrations for content creators.

It would be helpful to know if the comments are a requirement for the older Kobo systems or if they are just a suggestion.

In the example the content is wrapped in an HTML comment tag so that the content would not appear at all on platforms (Windows and Android) that do not currently read the Switch element. If the comment tag was not used and the book were loaded to the Kobo store the markup would display to the user on those platforms.
Wrapping the Switch in HTML comments is currently the best way to ensure that the content will not appear at all on Windows and Android while displaying either the primary or fallback content on iOS, eInk and Desktop.
The closest to ideal solution for more forward compatible content might be to leave out the HTML comment tag but include a note informing the user why they are seeing markup if they are on a platform that does not read the Switch element.

Just FYI, Kobo is the only major reading system to have implemented EPUB Switch in any way, and it is now on the list of things to possibly be removed in the EPUB 3.1 Working Group...