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

refdoc at crosswire.org refdoc at crosswire.org
Mon Mar 16 16:44:44 MST 2015


Author: refdoc
Date: 2015-03-16 16:44:44 -0700 (Mon, 16 Mar 2015)
New Revision: 3351

Modified:
   trunk/src/modules/filters/teilatex.cpp
   trunk/src/modules/filters/thmllatex.cpp
Log:
teilatex is now probably complete, thmllatex is started


Modified: trunk/src/modules/filters/teilatex.cpp
===================================================================
--- trunk/src/modules/filters/teilatex.cpp	2015-03-16 19:12:09 UTC (rev 3350)
+++ trunk/src/modules/filters/teilatex.cpp	2015-03-16 23:44:44 UTC (rev 3351)
@@ -132,7 +132,7 @@
 		else if (!strcmp(tag.getName(), "div")) {
 
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				buf += "<!P>";
+				buf += "";
 			}
 			else if (tag.isEndTag()) {
 			}
@@ -140,7 +140,7 @@
 
 		// <lb.../>
 		else if (!strcmp(tag.getName(), "lb")) {
-			buf += "<br />";
+			buf += "//\n";
 		}
 
 		// <pos>, <gen>, <case>, <gram>, <number>, <mood>, <pron>, <def>
@@ -149,8 +149,14 @@
 				 !strcmp(tag.getName(), "case") || 
 				 !strcmp(tag.getName(), "gram") || 
 				 !strcmp(tag.getName(), "number") || 
-				 !strcmp(tag.getName(), "pron") /*||
-				 !strcmp(tag.getName(), "def")*/) {
+				 !strcmp(tag.getName(), "pron") ||
+				 !strcmp(tag.getName(), "tr") || 
+				 !strcmp(tag.getName(), "orth") ||
+				 !strcmp(tag.getName(), "etym") || 
+				 !strcmp(tag.getName(), "usg") ||
+				 
+				 
+				 !strcmp(tag.getName(), "def")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
 				buf += "\\tei";
 				buf += tag.getName();
@@ -161,31 +167,6 @@
 			}
 		}
 
-		// <tr>
-		else if (!strcmp(tag.getName(), "tr")) {
-			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				buf += "\\teitr";
-			}
-			else if (tag.isEndTag()) {
-				buf += "}";
-			}
-		}
-		
-		// orth
-		else if (!strcmp(tag.getName(), "orth")) {
-			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
-				buf += "\\teiorth{";
-			}
-			else if (tag.isEndTag()) {
-				buf += "}";
-			}
-		}
-
-		// <etym>, <usg>
-		else if (!strcmp(tag.getName(), "etym") || 
-				 !strcmp(tag.getName(), "usg")) {
-			// do nothing here
-		}
 		else if (!strcmp(tag.getName(), "ref")) {
 			if (!tag.isEndTag()) {
 				u->suspendTextPassThru = true;

Modified: trunk/src/modules/filters/thmllatex.cpp
===================================================================
--- trunk/src/modules/filters/thmllatex.cpp	2015-03-16 19:12:09 UTC (rev 3350)
+++ trunk/src/modules/filters/thmllatex.cpp	2015-03-16 23:44:44 UTC (rev 3351)
@@ -163,8 +163,8 @@
 	addAllowedEscapeString("oslash"); // "ø"
 
 	setTokenCaseSensitive(true);
-//	addTokenSubstitute("scripture", "<i> ");
-	addTokenSubstitute("/scripture", "</i> ");
+	addTokenSubstitute("scripture", " \\swordquote{ ");
+	addTokenSubstitute("/scripture", "}");
 
 	renderNoteNumbers = false;
 }
@@ -194,16 +194,22 @@
 						value.c_str());
 			}
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
-				char ch = *value;
-				value<<1;
-				buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\" class=\"strongs\">",
+				if (!tag.isEndTag()) {
+				        char ch = *value;
+				        value<<1;
+				        buf.appendFormatted("\\swordstrong[%s]{%s}",
 						    ((ch == 'H') ? "Hebrew" : "Greek"),
-						    URL::encode(value.c_str()).c_str());
-				buf += (value.length()) ? value.c_str() : "";
-				buf += "</a>&gt;</em></small>";
-			}
+						    value.c_str());
+                                        }
+                                else { 	buf += "}"; }
+                        }
+				
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Dict")) {
-				buf += (tag.isEndTag() ? "</b>" : "<b>");
+				if (!tag.isEndTag()) {
+				        buf.appendFormatted("\\sworddict{%s}",
+						    value.c_str());
+                                }
+                                else { buf += "}"; }
 			}
 				
 		}




More information about the sword-cvs mailing list