[sword-svn] r2801 - trunk/src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Tue May 21 09:57:04 MST 2013


Author: scribe
Date: 2013-05-21 09:57:04 -0700 (Tue, 21 May 2013)
New Revision: 2801

Modified:
   trunk/src/modules/filters/osisxhtml.cpp
Log:
updated to support tables, sub, and super elements


Modified: trunk/src/modules/filters/osisxhtml.cpp
===================================================================
--- trunk/src/modules/filters/osisxhtml.cpp	2013-05-20 05:29:28 UTC (rev 2800)
+++ trunk/src/modules/filters/osisxhtml.cpp	2013-05-21 16:57:04 UTC (rev 2801)
@@ -35,15 +35,12 @@
 
 const char *OSISXHTML::getHeader() const {
 	return "\
-		.divineName {\
-			font-variant: small-caps;\
-		}\
-		.wordsOfJesus {\
-			color: red;\
-		}\
-		.transChangeSupplied {\
-			font-style: italic;\
-		}\
+		.divineName { font-variant: small-caps; }\n\
+		.wordsOfJesus { color: red; }\n\
+		.transChangeSupplied { font-style: italic; }\n\
+		.small, .sub, .sup { font-size: .83em }\n\
+		.sub             { vertical-align: sub }\n\
+		.sup             { vertical-align: super }\n\
 	";
 }
 
@@ -487,7 +484,7 @@
 		// <list>
 		else if (!strcmp(tag.getName(), "list")) {
 			if((!tag.isEndTag()) && (!tag.isEmpty())) {
-				outText("<ul>", buf, u);
+				outText("<ul>\n", buf, u);
 			}
 			else if (tag.isEndTag()) {
 				outText("</ul>\n", buf, u);
@@ -540,6 +537,12 @@
 				else if (type == "ol") {
 					outText("<span style=\"text-decoration:overline\">", buf, u);
 				}
+				else if (type == "super") {
+					outText("<span class=\"sup\">", buf, u);
+				}
+				else if (type == "sub") {
+					outText("<span class=\"sub\">", buf, u);
+				}
 				else {	// all other types
 					outText("<i>", buf, u);
 				}
@@ -556,7 +559,9 @@
 				if (type == "bold" || type == "b" || type == "x-b") {
 					outText("</b>", buf, u);
 				}
-				else if (type == "ol") {
+				else if (  	   type == "ol"
+						|| type == "super"
+						|| type == "sub") {
 					outText("</span>", buf, u);
 				}
 				else outText("</i>", buf, u);
@@ -697,7 +702,32 @@
 		else if (!strcmp(tag.getName(), "br")) {
 			buf += tag;
 		}
-
+		else if (!strcmp(tag.getName(), "table")) {
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				buf += "<table><tbody>\n";
+			}
+			else if (tag.isEndTag()) {
+				buf += "</tbody></table>\n";
+			}
+			
+		}
+		else if (!strcmp(tag.getName(), "row")) {
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				buf += "\t<tr>";
+			}
+			else if (tag.isEndTag()) {
+				buf += "</tr>\n";
+			}
+			
+		}
+		else if (!strcmp(tag.getName(), "cell")) {
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				buf += "<td>";
+			}
+			else if (tag.isEndTag()) {
+				buf += "</td>";
+			}
+		}
 		else {
 		      return false;  // we still didn't handle token
 		}




More information about the sword-cvs mailing list