baskerville / plato

Document reader
Other
1.26k stars 105 forks source link

Element is not displayed if class attribute value is not quoted #233

Closed thataboy closed 2 years ago

thataboy commented 2 years ago

I encountered a book where some paragraphs were not showing up in Plato. I finally figured out the problem

<html>
<body>
<p class=foo>hello, world</p>
</body>
</html>

This file will show up blank in Plato because foo is not quoted. The HTML specs say

Attributes are placed inside the start tag, and consist of a name and a value, separated by an = character. The attribute value can remain unquoted if it doesn’t contain spaces or any of " ' ` = < or >.

baskerville commented 2 years ago

What do you get when you run EPUBCheck on the aforementioned book?

thataboy commented 2 years ago

You're right it doesn't pass epubcheck because of the unquoted attribute value. I guess it's the book's fault, though perhaps the epub reader should be more lenient on this point?