[sword-svn] r1716 - trunk/utilities
jansorg at crosswire.org
jansorg at crosswire.org
Thu Feb 10 04:10:16 MST 2005
Author: jansorg
Date: 2005-02-10 04:09:38 -0700 (Thu, 10 Feb 2005)
New Revision: 1716
Modified:
trunk/utilities/osis2mod.cpp
Log:
Fix to osis2mod to not include the end of a chapter <div> to the last verse of a chapter. That mixes up frontends! There's no way to tell if the appended div belongs to the verse or to a sourrounding tag
Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp 2005-02-08 10:06:35 UTC (rev 1715)
+++ trunk/utilities/osis2mod.cpp 2005-02-10 11:09:38 UTC (rev 1716)
@@ -229,6 +229,11 @@
if (chapterTagEnd+1 == titleTagStart) {
const char* titleTagEnd = strstr(text.c_str(), "</title>");
+ while (strstr(titleTagEnd+8, "</title>")) {
+ titleTagEnd = strstr(titleTagEnd+8, "</title>");
+ }
+
+
const char* textEnd = text.c_str() + text.length();
if (titleTagEnd+8 == textEnd) {
text.setSize(chapterTagEnd+1-text.c_str()); //only insert the <chapter...> part
@@ -323,8 +328,13 @@
text = "";
return true;
}
- else if (!inVerse && (token.isEndTag() || (token.getAttribute("eID"))) && (!strcmp(token.getName(), "p") || !strcmp(token.getName(), "div") || !strcmp(token.getName(), "q") || !strcmp(token.getName(), "l") || !strcmp(token.getName(), "lg"))) {
- text.append( token );
+/* else if (!inVerse && (token.isEndTag() || (token.getAttribute("eID"))) && (!strcmp(token.getName(), "p") || !strcmp(token.getName(), "div") || !strcmp(token.getName(), "q") || !strcmp(token.getName(), "l") || !strcmp(token.getName(), "lg"))) {*/
+
+//we really should decide how to handle end tags /e.g. of a chapter). There's no way for frontends to
+//see to what OSIS tag the end tag (which is added to the verse text!) belongs. It mixes up the rendering as a result
+//excluded /div for now (jansorg)
+ else if (!inVerse && (token.isEndTag() || (token.getAttribute("eID"))) && (!strcmp(token.getName(), "p") || !strcmp(token.getName(), "q") || !strcmp(token.getName(), "l") || !strcmp(token.getName(), "lg"))) {
+ //text.append( token );
writeEntry(*currentVerse, text, true);
text = "";
return true;
More information about the sword-cvs
mailing list