[sword-svn] r2220 - in trunk: . src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Fri Dec 26 19:05:30 MST 2008


Author: scribe
Date: 2008-12-26 19:05:30 -0700 (Fri, 26 Dec 2008)
New Revision: 2220

Modified:
   trunk/ChangeLog
   trunk/src/modules/filters/osishtmlhref.cpp
   trunk/src/modules/filters/osisplain.cpp
   trunk/src/modules/filters/osisrtf.cpp
   trunk/src/modules/filters/thmlosis.cpp
   trunk/src/modules/filters/thmlplain.cpp
Log:
Applied Greg Hellings patch which adds support for list/item
in OSIS and cleans up other filters


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-12-23 10:30:04 UTC (rev 2219)
+++ trunk/ChangeLog	2008-12-27 02:05:30 UTC (rev 2220)
@@ -1,5 +1,8 @@
 API ChangeLog 
 
+26-Dec-2008	Troy A. Griffitts <scribe at crosswire.org>
+	Added list support in OSIS HTML conversion (ghellings)
+
 23-Dec-2008	Troy A. Griffitts <scribe at crosswire.org>
 	Added ignore of comment lines starting with '#'
 		in SWConfig processing

Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp	2008-12-23 10:30:04 UTC (rev 2219)
+++ trunk/src/modules/filters/osishtmlhref.cpp	2008-12-27 02:05:30 UTC (rev 2220)
@@ -383,7 +383,26 @@
 				outText("</b><br />", buf, u);
 			}
 		}
+		
+		// <list>
+		else if (!strcmp(tag.getName(), "list")) {
+			if((!tag.isEndTag()) && (!tag.isEmpty())) {
+				outText("<ul>", buf, u);
+			}
+			else if (tag.isEndTag()) {
+				outText("</ul>", buf, u);
+			}
+		}
 
+		// <item>
+		else if (!strcmp(tag.getName(), "item")) {
+			if((!tag.isEndTag()) && (!tag.isEmpty())) {
+				outText("<li>", buf, u);
+			}
+			else if (tag.isEndTag()) {
+				outText("</li>", buf, u);
+			}
+		}
 		// <catchWord> & <rdg> tags (italicize)
 		else if (!strcmp(tag.getName(), "rdg") || !strcmp(tag.getName(), "catchWord")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {

Modified: trunk/src/modules/filters/osisplain.cpp
===================================================================
--- trunk/src/modules/filters/osisplain.cpp	2008-12-23 10:30:04 UTC (rev 2219)
+++ trunk/src/modules/filters/osisplain.cpp	2008-12-27 02:05:30 UTC (rev 2220)
@@ -161,13 +161,13 @@
 		// <note> tag
 		else if (!strncmp(token, "note", 4)) {
 				if (!strstr(token, "strongsMarkup")) {	// leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
-					buf.append(" (");
+					buf.append(" [");
 				}
 				else	u->suspendTextPassThru = true;
 			}
 		else if (!strncmp(token, "/note", 5)) {
 			if (!u->suspendTextPassThru)
-				buf.append(')');
+				buf.append("] ");
 			else	u->suspendTextPassThru = false;
 		}
 

Modified: trunk/src/modules/filters/osisrtf.cpp
===================================================================
--- trunk/src/modules/filters/osisrtf.cpp	2008-12-23 10:30:04 UTC (rev 2219)
+++ trunk/src/modules/filters/osisrtf.cpp	2008-12-27 02:05:30 UTC (rev 2220)
@@ -316,7 +316,26 @@
 				outText("\\par}", buf, u);
 			}
 		}
+		// <list>	 - how do we support these better in RTF?
+		else if (!strcmp(tag.getName(), "list")) {
+			if((!tag.isEndTag()) && (!tag.isEmpty())) {
+				outText("\\par\\pard", buf, u);
+			}
+			else if (tag.isEndTag()) {
+				outText("\\par\\pard", buf, u);
+			}
+		}
 
+		// <item> - support better
+		else if (!strcmp(tag.getName(), "item")) {
+			if((!tag.isEndTag()) && (!tag.isEmpty())) {
+				outText("* ", buf, u);
+			}
+			else if (tag.isEndTag()) {
+				outText("\\par", buf, u);
+			}
+		}
+
 		// <catchWord> & <rdg> tags (italicize)
 		else if (!strcmp(tag.getName(), "rdg") || !strcmp(tag.getName(), "catchWord")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {

Modified: trunk/src/modules/filters/thmlosis.cpp
===================================================================
--- trunk/src/modules/filters/thmlosis.cpp	2008-12-23 10:30:04 UTC (rev 2219)
+++ trunk/src/modules/filters/thmlosis.cpp	2008-12-27 02:05:30 UTC (rev 2220)
@@ -326,7 +326,7 @@
 			}
 
 			// Footnote
-			if (!strcmp(token, "note")) {
+			if (!strncmp(token, "note", 4)) {
 		        	//pushString(&to, "<note>");
 				text.append("<note>");
 				newText = true;

Modified: trunk/src/modules/filters/thmlplain.cpp
===================================================================
--- trunk/src/modules/filters/thmlplain.cpp	2008-12-23 10:30:04 UTC (rev 2219)
+++ trunk/src/modules/filters/thmlplain.cpp	2008-12-27 02:05:30 UTC (rev 2220)
@@ -177,14 +177,14 @@
 			}
 			if (!strncmp("note", token, 4)) {
 				text += ' ';
-				text += '(';
+				text += '[';
 			}
 			else if (!strncmp("br", token, 2))
 				text += '\n';
 			else if (!strncmp("/p", token, 2))
 				text += '\n';
 			else if (!strncmp("/note", token, 5)) {
-				text += ')';
+				text += ']';
 				text += ' ';
 			}
 			continue;




More information about the sword-cvs mailing list