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

refdoc at crosswire.org refdoc at crosswire.org
Sun Feb 2 13:18:22 MST 2020


Author: refdoc
Date: 2020-02-02 13:18:22 -0700 (Sun, 02 Feb 2020)
New Revision: 3691

Modified:
   trunk/src/modules/filters/teilatex.cpp
Log:
added <list> and <item> tags to TEI Latex filter


Modified: trunk/src/modules/filters/teilatex.cpp
===================================================================
--- trunk/src/modules/filters/teilatex.cpp	2020-02-02 09:40:55 UTC (rev 3690)
+++ trunk/src/modules/filters/teilatex.cpp	2020-02-02 20:18:22 UTC (rev 3691)
@@ -311,8 +311,55 @@
 				buf += "";
 			}
 		}
+		// <list> <item>
+		else if (!strcmp(tag.getName(), "list")) {
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
 
+				SWBuf rend = tag.getAttribute("rend");
+				
+				u->lastHi = rend;
+				if (rend == "numbered") {
+					buf += "\\begin{enumerate}\n";
+					}
+				else if (rend == "bulleted") {
+					buf += "\\begin{itemize}\n";
+				}
+				else {
+					buf += "\\begin{list-"; 
+					buf += rend.c_str(); 
+					buf += "}\n";
+				}
+			}
+			else if (tag.isEndTag()) {
+				SWBuf rend = u->lastHi;
+				if (rend == "numbered") {
+					buf += "\\end{enumerate}\n>";
+				}
+				else if (rend == "bulletted") {
+					buf += "\\end{itemize}\n";
+				
+				}
+				else {
+					buf += "\\end{list-";
+					buf += rend;
+					buf += "}\n";
+				}
+				u->supressAdjacentWhitespace = true;
+			}
+		}
+		else if (!strcmp(tag.getName(), "item")) {
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				buf += "\\item";
+			}
+		}
+		else {
+			return false;  // we still didn't handle token
+		}
 
+
+	}
+
+
 		else {
 			return false;  // we still didn't handle token
 		}




More information about the sword-cvs mailing list