Conversation
niloc132
left a comment
There was a problem hiding this comment.
It doesn't increase compiled size at all, and improves compatibility... I think I'm in favor of it?
If we do identify a downside, we could extract this as a constant so that projects could use configuration properties to control it rather than just the single constant.
But as far as I can tell, using the # syntax should make it only more compatible rather than less compatible - every browser should support the non-special cased xml escapes?
|
If you have control over the doctype you can also import the missing named entities. XHTML is modular and thus nearly all named entities have been moved to modules and you have to import them if required. Every browser supports the hex notation so it should not be an issue for GWT. It is less readable though if you don't know what   or   represent. I would favor nbsp and import the XHTML module but I assume epub readers don't like imports that much. |
|
Thanks for your encouraging assessment and the remark regarding XHTML entities. Based on this I did some more digging and defined the The use of nevertheless throw an error: Note, this is not even ePub related but seems to be a quirk with XHTML... |
|
Looks like the flavor of xhtml supported in epub doesn't support any named entities, see https://ebooks.stackexchange.com/a/7001 This appears to be a change in epub3, see https://www.mail-archive.com/docbook-apps@lists.oasis-open.org/msg20132.html and https://www.mobileread.com/forums/showpost.php?s=267124a77d91aea967edc6c39cd216c4&p=3821413&postcount=3 @jnehlmeier any other thoughts, given that defining the entity doesn't seem to work? Maybe you'd like a comment in each place to specify that 0xa0 is a non-breaking space? |
|
Yes a comment like As @evoludolab said it is possible to define |
|
Thanks for this constructive discussion! I wish I had come across the helpful pages @niloc132 pointed out a long time ago... I have now added explanatory comments as @jnehlmeier suggested and merged the latest changes on |
| panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); | ||
|
|
||
| HTML first = new HTML(" ", true), rest = new HTML(" ", true); | ||
| HTML first = new HTML(" ", true), rest = new HTML(" ", true); // ' ': ePub/XHTML friendly |
There was a problem hiding this comment.
To fix this style issue, maybe move the comment to the previous line - might make sense for other lines too.
There was a problem hiding this comment.
Sure. Done consistently for all occurrences.
GWT is a great tool to bring interactivity in ebooks to a whole new level. Unfortunately, the epub v3 specs are still based on XHTML... even though the newer bells and whistles of HTML5 are acceptable too.
With respect to GWT, issue arise solely due to the
character entity, which is undefined inXHTML. Once replaced by GWT works like a charm inside any epub (and javascript capable reader).This PR does just that by replacing those characters but only where it matters, e.g. no replacements under the
testorsamplesdirectories.