[sword-devel] Preverse Headings titles/divs

Greg Hellings greg.hellings at gmail.com
Wed Apr 16 06:32:31 MST 2014


Troy,

There seems to be an issue in the implementation of the filter for this.
I'm currently getting the following from "lookup":

        [ Preverse ]

                0 = <div canonical="true" sID="gen30107" subType="x-SH"
type="section"/><title>Bartimaeus Receives His Sight</title> <div
sID="gen30108" type="x-p"/>

                module->renderText(heading[0]) = <h3><h3>Bartimaeus
Receives His Sight</h3>


</h3>


The engine's filter is already wrapping the render text in double-h3 tags,
so any applications doing that will end up triple-wrapping.

--Greg


On Tue, Apr 15, 2014 at 4:52 PM, Troy A. Griffitts <scribe at crosswire.org>wrote:

> Dear all SWORD frontend developers.
>
> In the 1.7 codebase we introduced the new concept of preverse divs instead
> of simply a set of preverse titles.  This was discussed at length over the
> years and we decided to move in this direction with everyone' consent,
> hopefully.
>
> We had an inconsistency in 1.7.[0-2] which I have just fixed and which you
> probably need to worry about:
>
>
> The problem:
>
> Previous, we were including preverse titles in the entryAttributes under:
>
> ["Heading"]["Preverse"]["0" ... n] = "Some Title"
>
> You were probably wrapping this in a nice <h2> or something and being done
> with it.
>
> In the new world of preverse divs which can contain anything-- not just
> titles, this would look like this:
>
> ["Heading"]["Preverse"]["0" ... n] = "<title>Some Title</title>"
>
> This was inconsistent.  The former relied on the frontend to set this
> apart as a title.  The later has the <title> tag included in whatever might
> be a title in the preverse material.
>
> The problem is that most of you (and me) didn't change any of our frontend
> code to handle the move to preverse div.  We tried to make this as easy of
> a transition as possible and thought we did, but not quite good enough.
>
> As it stands now, for older modules, you're probably rendering something
> like:
>
> <h3>Some Title</h3>
>
> But for newer modules you are probably rendering something like:
>
> <h3><h3>Some Title</h3></h3>
>
> You were adding your own markup to highlight these always as titles, and
> in the new world, the highlighting is done for you, if it is indeed a title
> (the OSIS <title> tag is actually in the body of the material and will get
> rendered as all other <title> elements).
>
> A bug fix, which I've just committed and will go out in 1.7.3 shortly,
> will make these consistent.  When processing headings, I am looking for old
> preverse title modules and I now preserve the containing "<title>" element.
>  This will make them act the same as the newer preverse div modules and
> both will appear consistently as:
>
> ["Heading"]["Preverse"]["0" ... n] = "<title>Some Title</title>"
>
>
> SUMMARY:  In the new preverse div world, you should never add your own
> markup around the preverse material which assumes the entire content is a
> title.  Simply remove your added markup and you should be good.
>
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20140416/60042822/attachment.html>


More information about the sword-devel mailing list