[sword-devel] Color in osis

Nathan Phillip Brink ohnobinki at ohnopublishing.net
Sun Mar 17 11:44:40 MST 2019


On Sun, Mar 17, 2019 at 10:07:29AM -0400, Karl Kleinpaste wrote:
> However, for this purpose, the deeper problem is that Sword erroneously
> generates self-closing <div> tags, which do not work. Search "html
> self-closing div" and discover all the conflicting noise over it. My
> solution in Xiphos was simply to obliterate these tags in introductory
> material; they have no visual manifestation and I don't know why the
> XHTML filters pass them in the 1st place. They look like
> 
> <div sID="gen34165" type="introduction"/>
> 
> and they caused my .introMaterial change to bleed throughout the chapter
> until I implemented the obliteration. See
> https://github.com/crosswire/xiphos/issues/845

It sounds like you’re trying to render XHTML using an HTML
parser. Oftentimes, you can switch an HTML parser to XML mode by
prefixing your XHTML with <?xml version="1.0"?>. Or by specifying the
Content-Type header as application/xhtml+xml (not sure how you do that
with embedded engines). Or you could preprocess the XHTML into HTML
first by parsing the XHTML with an XML parser and then serializing it
with an HTML serializer so that it is OK to feed to the HTML parser
(using xmllint as an example which sort of gets close):

    $ echo '<div class="my-class"/>asdf<div/>' | xmllint --html - | grep -e div
    <div class="my-class"></div>asdf<div></div>

-- 
binki

Don’t forget to check for missing or extraneous apostrophes!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20190317/53e0c5c5/attachment.sig>


More information about the sword-devel mailing list