Book group handling patch

Jesse Schwartzentruber <[email protected]>
Newsgroups gmane.comp.literature.sword.devel
Message-ID <mDLMkAn8606Usd-gtXmuYUYawNXeVsLnBArNhCOGBJBf0THKK8emYBP6q6DBd14BWLrYhfzCBssugyeij0HJTGdDsv8yswiOTh5Nszjb3TE=@jvfam.ca>
Hello,

I recently noticed this bug when formatting a Bible to OSIS:
https://tracker.crosswire.org/browse/MODTOOLS-8 I noticed both NET and WEB have the same issue (book group title appears at the end of Malachi and/or Apocrypha).

I put together a patch which works for me. It only moves the bookGroup start div tag for the New Testament and following title from the end of the ot​ file to the beginning of nt. This results in an OOPS message in the debug log, but it doesn't seem to have any unwanted effect on the output.

-Jesse

_______________________________________________
sword-devel mailing list: [email protected]
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
fix-bg.diff (text/x-patch, 725 B)
diff --git utilities/osis2mod.cpp utilities/osis2mod.cpp
index 38efa560..9f034a23 100644
--- utilities/osis2mod.cpp
+++ utilities/osis2mod.cpp
@@ -886,6 +886,14 @@ bool handleToken(SWBuf &text, XMLTag token) {
 
 		// Now consider everything else.
 
+		if (tokenName == "div" && typeAttr == "bookGroup") {
+			if (debug & DEBUG_OTHER) {
+				cout << "DEBUG(FOUND): Found bookGroup div, saving following material for book intro" << endl;
+			}
+			inBookIntro = true;
+			return false;
+		}
+
 /*
 		// "majorSection" is code for the Book 1-5 of Psalms // This is incorrect assumption - majorSection can appear in any large book and can start and end inside chapters
 		if (tokenName == "div" && typeAttr == "majorSection") {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.