<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 16, 2020 at 9:31 PM Karl Kleinpaste <<a href="mailto:karl@kleinpaste.org">karl@kleinpaste.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<font face="FreeSerif">From discussion here in March of last year, I
am attempting to get Xiphos to operate in a proper xhtml mode,
rather than its apparent heretofore html mode, because I honestly
wasn't aware that WebKit could operate other than xhtml in the
first place. The specific goal is to leave self-closing
<div> tags alone, as delivered by the Sword engine, rather
than having to obliterate them in a post-delivery hack. To this
end, using suggestions from Nathan Phillip Brink at the time, I've
made this change to the opening stanza of Xiphos' main display
widget:<br>
<br>
</font><tt>#define HTML_START \</tt><tt><br>
</tt><tt>- "<html><head><meta
http-equiv=\"content-type\" content=\"text/html;
charset=utf-8\"> \</tt><tt><br>
</tt><tt>+ "<?xml version=\"1.0\"?> \</tt><tt><br>
</tt><tt>+<!DOCTYPE html> \</tt><tt><br></tt></div></blockquote><div><br></div><div>This line is wrong. <!DOCTYPE html> will give you HTML 5, not XHTML. XHTML would be much wordier: <a href="https://en.wikipedia.org/wiki/Document_type_declaration#XHTML_Basic_DTDs">https://en.wikipedia.org/wiki/Document_type_declaration#XHTML_Basic_DTDs</a></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><tt>
</tt><tt>+<html xmlns=\<a href="http://www.w3.org/1999/xhtml%5C" target="_blank">"http://www.w3.org/1999/xhtml\"</a>> \</tt><tt><br>
</tt><tt>+<head><meta http-equiv=\"content-type\"
content=\"application/xhtml+xml; charset=utf-8\"> \</tt><font face="FreeSerif"><br>
<br>
Notable:<br>
- begins with <?xml...> line<br></font></div></blockquote><div><br></div><div>Doesn't seem to be strictly needed by browsers for XHTML rendering, but it shouldn't hurt, either.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><font face="FreeSerif">
- includes DOCTYPE (either html or xhtml) (also tried leaving this
off entirely, no diff)<br></font></div></blockquote><div><br></div><div>You will almost certainly need this to put the browser into XHTML mode</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><font face="FreeSerif">
- adds namespace to <html><br></font></div></blockquote><div><br></div><div>That will be needed, for sure.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><font face="FreeSerif">
- changes content type to application/xhtml+xml (also tried just
xhtml, no diff)<br></font></div></blockquote><div><br></div><div>That's not necessary to get you into XHTML mode.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><font face="FreeSerif">
<br>
Result so far is an all around no-joy. I am evidently still
getting WebKit behavior in HTML mode because the self-closing
<div> leads to my .introMaterial format/color change
bleeding through to the end of the chapter, as most clearly seen
in the (technically defunct, but I still have & use it)
ESV2011 module, in every book's 1:1. If I leave the post-delivery
hack in place, the self-closing <div> is eliminated
entirely, and the .introMaterial section is properly highlighted.<br></font></div></blockquote><div><br></div><div>So here's a thing I've learned:</div><div>The moment a browser finds anything that violates the XHTML standards it will dump you back into HTML 4.01 mode. That seems to be what you're getting, because <div/> is valid in XHTML but not in HTML 4.01. Secondly, all browsers ignore the doctype declaration at the top of a file. At least all modern browsers do. They only thing they care about is the Content-Type: in the HTTP header. Of course, you don't have an HTTP header, but surely you have a way to set it to "application/xhtml+xml"?</div><div><br></div><div>Relevant: <a href="https://stackoverflow.com/questions/97522/what-are-all-the-valid-self-closing-elements-in-xhtml-as-implemented-by-the-maj">https://stackoverflow.com/questions/97522/what-are-all-the-valid-self-closing-elements-in-xhtml-as-implemented-by-the-maj</a></div><div><br></div><div>--Greg<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><font face="FreeSerif">
<br>
Can anyone offer any further suggestions on how to induce the
right sort of behavior?<br>
</font>
</div>
_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" rel="noreferrer" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page</blockquote></div></div>