[sword-devel] intro material CSS

Karl Kleinpaste karl at kleinpaste.org
Mon Apr 9 05:30:14 MST 2018


On 04/08/2018 02:57 PM, Karl Kleinpaste wrote:
> Anyway... I can do it myself for Xiphos. I just figure that generality
> would say that the engine is well-positioned to provide this

Never mind. I have a bug to report.

I decided to do CSS on my own after all, at least as a better stopgap.
All N:0 intro sections deliver content including their own <div>
sections, marking them as type=introduction. The problem is that they
are self-closing i.e. <div .../>. This is seriously disliked by (in my
case) WebKit.

Example, ESV2011 Gen.1.1:
<div class="introMaterial"><div sID="gen2" type="introduction"/><br />
As its name implies, Genesis is about beginnings. [...plain text
elided...] some prefer a date around 1260 b.c.<br />
<div eID="gen2" type="introduction"/><br /><br /></div>

The "introMaterial" <div> is my addition, along with its closing </div>,
and the other <div type... /> are provided from Sword. Xiphos (WebKit)
reacts very poorly to this, with my introMaterial handler turning
everything from here to end of chapter italic and yellow because the
self-closing div are not recognized as having closed at all.

Some web searching about self-closing div reveals, on the one hand, a
lot of confusion and mixed opinion, but on the other hand generally
siding with the idea that div is not self-closing, at least in
practice/as implemented in XHTML renderers like WebKit. I've gone to the
trouble to catch this in gdb, wipe out the errant self-closing div to
spaces, and watch the result give me a correct intro-only italic and
yellow. (No, I don't intend yellow to be part of my eventual plan here.
This was just testing.)

It doesn't help to use span instead.

The use of self-closing div will have to end pretty much immediately.

https://github.com/crosswire/xiphos/issues/845
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20180409/b2fdd078/attachment.html>


More information about the sword-devel mailing list