[sword-devel] trying to get proper xhtml to work in webkit

Karl Kleinpaste karl at kleinpaste.org
Thu Apr 16 19:30:36 MST 2020


>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:

#define HTML_START \
-       "<html><head><meta http-equiv=\"content-type\"
content=\"text/html; charset=utf-8\"> \
+       "<?xml version=\"1.0\"?> \
+<!DOCTYPE html> \
+<html xmlns=\"http://www.w3.org/1999/xhtml\"> \
+<head><meta http-equiv=\"content-type\"
content=\"application/xhtml+xml; charset=utf-8\"> \

Notable:
- begins with <?xml...> line
- includes DOCTYPE (either html or xhtml) (also tried leaving this off
entirely, no diff)
- adds namespace to <html>
- changes content type to application/xhtml+xml (also tried just xhtml,
no diff)

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.

Can anyone offer any further suggestions on how to induce the right sort
of behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20200416/b0a1ae88/attachment.html>


More information about the sword-devel mailing list