The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
thmlhtml.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * thmlhtml.cpp - ThML to HTML filter
4  *
5  * $Id: thmlhtml.cpp 3547 2017-12-10 05:06:48Z scribe $
6  *
7  * Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
8  * CrossWire Bible Society
9  * P. O. Box 2528
10  * Tempe, AZ 85280-2528
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU General Public License as published by the
14  * Free Software Foundation version 2.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  */
22 
23 #include <stdlib.h>
24 #include <thmlhtml.h>
25 #include <swmodule.h>
26 #include <utilxml.h>
27 
28 
30 
31 
33  setTokenStart("<");
34  setTokenEnd(">");
35 
36  setEscapeStart("&");
37  setEscapeEnd(";");
38 
41 
42  addAllowedEscapeString("quot");
46 
47  addAllowedEscapeString("nbsp");
48  addAllowedEscapeString("brvbar"); // "¦"
49  addAllowedEscapeString("sect"); // "§"
50  addAllowedEscapeString("copy"); // "©"
51  addAllowedEscapeString("laquo"); // "«"
52  addAllowedEscapeString("reg"); // "®"
53  addAllowedEscapeString("acute"); // "´"
54  addAllowedEscapeString("para"); // "¶"
55  addAllowedEscapeString("raquo"); // "»"
56 
57  addAllowedEscapeString("Aacute"); // "Á"
58  addAllowedEscapeString("Agrave"); // "À"
59  addAllowedEscapeString("Acirc"); // "Â"
60  addAllowedEscapeString("Auml"); // "Ä"
61  addAllowedEscapeString("Atilde"); // "Ã"
62  addAllowedEscapeString("Aring"); // "Å"
63  addAllowedEscapeString("aacute"); // "á" addAllowedEscapeString("agrave"); // "à" addAllowedEscapeString("acirc"); // "â" addAllowedEscapeString("auml"); // "ä" addAllowedEscapeString("atilde"); // "ã" addAllowedEscapeString("aring"); // "å" addAllowedEscapeString("Eacute"); // "É" addAllowedEscapeString("Egrave"); // "È" addAllowedEscapeString("Ecirc"); // "Ê" addAllowedEscapeString("Euml"); // "Ë" addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
64  addAllowedEscapeString("agrave"); // "à" addAllowedEscapeString("acirc"); // "â" addAllowedEscapeString("auml"); // "ä" addAllowedEscapeString("atilde"); // "ã" addAllowedEscapeString("aring"); // "å" addAllowedEscapeString("Eacute"); // "É" addAllowedEscapeString("Egrave"); // "È" addAllowedEscapeString("Ecirc"); // "Ê" addAllowedEscapeString("Euml"); // "Ë" addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
65  addAllowedEscapeString("acirc"); // "â" addAllowedEscapeString("auml"); // "ä" addAllowedEscapeString("atilde"); // "ã" addAllowedEscapeString("aring"); // "å" addAllowedEscapeString("Eacute"); // "É" addAllowedEscapeString("Egrave"); // "È" addAllowedEscapeString("Ecirc"); // "Ê" addAllowedEscapeString("Euml"); // "Ë" addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
66  addAllowedEscapeString("auml"); // "ä" addAllowedEscapeString("atilde"); // "ã" addAllowedEscapeString("aring"); // "å" addAllowedEscapeString("Eacute"); // "É" addAllowedEscapeString("Egrave"); // "È" addAllowedEscapeString("Ecirc"); // "Ê" addAllowedEscapeString("Euml"); // "Ë" addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
67  addAllowedEscapeString("atilde"); // "ã" addAllowedEscapeString("aring"); // "å" addAllowedEscapeString("Eacute"); // "É" addAllowedEscapeString("Egrave"); // "È" addAllowedEscapeString("Ecirc"); // "Ê" addAllowedEscapeString("Euml"); // "Ë" addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
68  addAllowedEscapeString("aring"); // "å" addAllowedEscapeString("Eacute"); // "É" addAllowedEscapeString("Egrave"); // "È" addAllowedEscapeString("Ecirc"); // "Ê" addAllowedEscapeString("Euml"); // "Ë" addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
69  addAllowedEscapeString("Eacute"); // "É"
70  addAllowedEscapeString("Egrave"); // "È"
71  addAllowedEscapeString("Ecirc"); // "Ê"
72  addAllowedEscapeString("Euml"); // "Ë"
73  addAllowedEscapeString("eacute"); // "é" addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
74  addAllowedEscapeString("egrave"); // "è" addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
75  addAllowedEscapeString("ecirc"); // "ê" addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
76  addAllowedEscapeString("euml"); // "ë" addAllowedEscapeString("Iacute"); // "Í" addAllowedEscapeString("Igrave"); // "Ì" addAllowedEscapeString("Icirc"); // "Î" addAllowedEscapeString("Iuml"); // "Ï" addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
77  addAllowedEscapeString("Iacute"); // "Í"
78  addAllowedEscapeString("Igrave"); // "Ì"
79  addAllowedEscapeString("Icirc"); // "Î"
80  addAllowedEscapeString("Iuml"); // "Ï"
81  addAllowedEscapeString("iacute"); // "í" addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
82  addAllowedEscapeString("igrave"); // "ì" addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
83  addAllowedEscapeString("icirc"); // "î" addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
84  addAllowedEscapeString("iuml"); // "ï" addAllowedEscapeString("Oacute"); // "Ó" addAllowedEscapeString("Ograve"); // "Ò" addAllowedEscapeString("Ocirc"); // "Ô" addAllowedEscapeString("Ouml"); // "Ö" addAllowedEscapeString("Otilde"); // "Õ" addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
85  addAllowedEscapeString("Oacute"); // "Ó"
86  addAllowedEscapeString("Ograve"); // "Ò"
87  addAllowedEscapeString("Ocirc"); // "Ô"
88  addAllowedEscapeString("Ouml"); // "Ö"
89  addAllowedEscapeString("Otilde"); // "Õ"
90  addAllowedEscapeString("oacute"); // "ó" addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
91  addAllowedEscapeString("ograve"); // "ò" addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
92  addAllowedEscapeString("ocirc"); // "ô" addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
93  addAllowedEscapeString("ouml"); // "ö" addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
94  addAllowedEscapeString("otilde"); // "õ" addAllowedEscapeString("Uacute"); // "Ú" addAllowedEscapeString("Ugrave"); // "Ù" addAllowedEscapeString("Ucirc"); // "Û" addAllowedEscapeString("Uuml"); // "Ü" addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
95  addAllowedEscapeString("Uacute"); // "Ú"
96  addAllowedEscapeString("Ugrave"); // "Ù"
97  addAllowedEscapeString("Ucirc"); // "Û"
98  addAllowedEscapeString("Uuml"); // "Ü"
99  addAllowedEscapeString("uacute"); // "ú" addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
100  addAllowedEscapeString("ugrave"); // "ù" addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
101  addAllowedEscapeString("ucirc"); // "û" addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
102  addAllowedEscapeString("uuml"); // "ü" addAllowedEscapeString("Yacute"); // "Ý" addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
103  addAllowedEscapeString("Yacute"); // "Ý"
104  addAllowedEscapeString("yacute"); // "ý" addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
105  addAllowedEscapeString("yuml"); // "ÿ" addAllowedEscapeString("deg"); // "°" addAllowedEscapeString("plusmn"); // "±" addAllowedEscapeString("sup2"); // "²" addAllowedEscapeString("sup3"); // "³" addAllowedEscapeString("sup1"); // "¹" addAllowedEscapeString("nbsp"); // "º" addAllowedEscapeString("pound"); // "£" addAllowedEscapeString("cent"); // "¢" addAllowedEscapeString("frac14"); // "¼" addAllowedEscapeString("frac12"); // "½" addAllowedEscapeString("frac34"); // "¾" addAllowedEscapeString("iquest"); // "¿" addAllowedEscapeString("iexcl"); // "¡" addAllowedEscapeString("ETH"); // "Ð" addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
106 
107  addAllowedEscapeString("deg"); // "°"
108  addAllowedEscapeString("plusmn"); // "±"
109  addAllowedEscapeString("sup2"); // "²"
110  addAllowedEscapeString("sup3"); // "³"
111  addAllowedEscapeString("sup1"); // "¹"
112  addAllowedEscapeString("nbsp"); // "º"
113  addAllowedEscapeString("pound"); // "£"
114  addAllowedEscapeString("cent"); // "¢"
115  addAllowedEscapeString("frac14"); // "¼"
116  addAllowedEscapeString("frac12"); // "½"
117  addAllowedEscapeString("frac34"); // "¾"
118  addAllowedEscapeString("iquest"); // "¿"
119  addAllowedEscapeString("iexcl"); // "¡"
120  addAllowedEscapeString("ETH"); // "Ð"
121  addAllowedEscapeString("eth"); // "ð" addAllowedEscapeString("THORN"); // "Þ" addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
122  addAllowedEscapeString("THORN"); // "Þ"
123  addAllowedEscapeString("thorn"); // "þ" addAllowedEscapeString("AElig"); // "Æ" addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
124  addAllowedEscapeString("AElig"); // "Æ"
125  addAllowedEscapeString("aelig"); // "æ" addAllowedEscapeString("Oslash"); // "Ø" addAllowedEscapeString("curren"); // "¤" addAllowedEscapeString("Ccedil"); // "Ç" addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
126  addAllowedEscapeString("Oslash"); // "Ø"
127  addAllowedEscapeString("curren"); // "¤"
128  addAllowedEscapeString("Ccedil"); // "Ç"
129  addAllowedEscapeString("ccedil"); // "ç" addAllowedEscapeString("szlig"); // "ß" addAllowedEscapeString("Ntilde"); // "Ñ" addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
130  addAllowedEscapeString("szlig"); // "ß"
131  addAllowedEscapeString("Ntilde"); // "Ñ"
132  addAllowedEscapeString("ntilde"); // "ñ" addAllowedEscapeString("yen"); // "¥" addAllowedEscapeString("not"); // "¬" addAllowedEscapeString("ordf"); // "ª" addAllowedEscapeString("uml"); // "¨" addAllowedEscapeString("shy"); // "­" addAllowedEscapeString("macr"); // "¯" addAllowedEscapeString("micro"); // "µ" addAllowedEscapeString("middot"); // "·" addAllowedEscapeString("cedil"); // "¸" addAllowedEscapeString("ordm"); // "º" addAllowedEscapeString("times"); // "×" addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
133  addAllowedEscapeString("yen"); // "¥"
134  addAllowedEscapeString("not"); // "¬"
135  addAllowedEscapeString("ordf"); // "ª"
136  addAllowedEscapeString("uml"); // "¨"
137  addAllowedEscapeString("shy"); // "­"
138  addAllowedEscapeString("macr"); // "¯"
139 
140  addAllowedEscapeString("micro"); // "µ"
141  addAllowedEscapeString("middot"); // "·"
142  addAllowedEscapeString("cedil"); // "¸"
143  addAllowedEscapeString("ordm"); // "º"
144  addAllowedEscapeString("times"); // "×"
145  addAllowedEscapeString("divide"); // "÷" addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
146  addAllowedEscapeString("oslash"); // "ø" setTokenCaseSensitive(true); addTokenSubstitute("note", " <font color=\"#800000\"><small>("); addTokenSubstitute("/note", ")</small></font> "); } bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution MyUserData *u = (MyUserData *)userData; XMLTag tag(token); if (!strcmp(tag.getName(), "sync")) { if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) { const char* value = tag.getAttribute("value"); if (*value == 'H' || *value == 'G' || *value == 'A') { value++; buf += "<small><em>"; buf += value; buf += "</em></small>"; } else if (*value == 'T') { value += 2; buf += "<small><i>"; buf += value; buf += "</i></small>"; } } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) { buf += "<small><em>"; buf += tag.getAttribute("value"); buf += "</em></small>"; } else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) { buf += "<small><em>("; buf += tag.getAttribute("value"); buf += ")</em></small>"; } } else if (!strcmp(tag.getName(), "div")) { if (tag.isEndTag() && (u->inSecHead)) { buf += "</i></b><br />"; u->inSecHead = false; } else if (tag.getAttribute("class")) { if (!strcmp(tag.getAttribute("class"), "sechead")) { u->inSecHead = true; buf += "<br /><b><i>"; } else if (!strcmp(tag.getAttribute("class"), "title")) { u->inSecHead = true; buf += "<br /><b><i>"; } } } else if (!strcmp(tag.getName(), "img")) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute return false; buf += '<'; for (const char *c = token; *c; c++) { if (c == src) { for (;((*c) && (*c != '"')); c++) buf += *c; if (!*c) { c--; continue; } buf += '"'; if (*(c+1) == '/') { buf += "file:"; buf += userData->module->getConfigEntry("AbsoluteDataPath"); if (buf[buf.length()-2] == '/') c++; // skip '/' } continue; } buf += *c; } buf += '>'; } else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out } else { buf += '<'; buf += token; buf += '>'; // return false; // we still didn't handle token } } return true; } SWORD_NAMESPACE_END
147 
148  setTokenCaseSensitive(true);
149 
150  addTokenSubstitute("note", " <font color=\"#800000\"><small>(");
151  addTokenSubstitute("/note", ")</small></font> ");
152 }
153 
154 
155 bool ThMLHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
156  if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
157  MyUserData *u = (MyUserData *)userData;
158  XMLTag tag(token);
159  if (!strcmp(tag.getName(), "sync")) {
160  if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) {
161  const char* value = tag.getAttribute("value");
162  if (*value == 'H' || *value == 'G' || *value == 'A') {
163  value++;
164  buf += "<small><em>";
165  buf += value;
166  buf += "</em></small>";
167  }
168  else if (*value == 'T') {
169  value += 2;
170 
171  buf += "<small><i>";
172  buf += value;
173  buf += "</i></small>";
174  }
175  }
176  else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "morph")) {
177  buf += "<small><em>";
178  buf += tag.getAttribute("value");
179  buf += "</em></small>";
180  }
181  else if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "lemma")) {
182  buf += "<small><em>(";
183  buf += tag.getAttribute("value");
184  buf += ")</em></small>";
185  }
186  }
187  else if (!strcmp(tag.getName(), "div")) {
188  if (tag.isEndTag() && (u->inSecHead)) {
189  buf += "</i></b><br />";
190  u->inSecHead = false;
191  }
192  else if (tag.getAttribute("class")) {
193  if (!strcmp(tag.getAttribute("class"), "sechead")) {
194  u->inSecHead = true;
195  buf += "<br /><b><i>";
196  }
197  else if (!strcmp(tag.getAttribute("class"), "title")) {
198  u->inSecHead = true;
199  buf += "<br /><b><i>";
200  }
201  }
202  }
203  else if (!strcmp(tag.getName(), "img")) {
204  const char *src = strstr(token, "src");
205  if (!src) // assert we have a src attribute
206  return false;
207 
208  buf += '<';
209  for (const char *c = token; *c; c++) {
210  if (c == src) {
211  for (;((*c) && (*c != '"')); c++)
212  buf += *c;
213 
214  if (!*c) { c--; continue; }
215 
216  buf += '"';
217  if (*(c+1) == '/') {
218  buf += "file:";
219  buf += userData->module->getConfigEntry("AbsoluteDataPath");
220  if (buf[buf.length()-2] == '/')
221  c++; // skip '/'
222  }
223  continue;
224  }
225  buf += *c;
226  }
227  buf += '>';
228  }
229  else if (!strcmp(tag.getName(), "scripRef")) { //do nothing with scrip refs, we leave them out
230 
231  }
232  else {
233  buf += '<';
234  buf += token;
235  buf += '>';
236 
237 // return false; // we still didn't handle token
238  }
239  }
240  return true;
241 }
242 
243 
#define SWORD_NAMESPACE_START
Definition: defs.h:39
void setTokenEnd(const char *tokenEnd)
void addAllowedEscapeString(const char *findString)
Definition: swbuf.h:47
unsigned long length() const
Definition: swbuf.h:197
virtual const char * getConfigEntry(const char *key) const
Definition: swmodule.cpp:1159
const SWModule * module
Definition: swbasicfilter.h:42
const char * getName() const
Definition: utilxml.h:58
Definition: utilxml.h:38
void setTokenCaseSensitive(bool val)
void setEscapeStart(const char *escStart)
bool substituteToken(SWBuf &buf, const char *token)
void setTokenStart(const char *tokenStart)
void setPassThruNumericEscapeString(bool val)
ThMLHTML()
Definition: thmlhtml.cpp:32
const char * getAttribute(const char *attribName, int partNum=-1, char partSplit= '|') const
Definition: utilxml.cpp:230
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData)
Definition: thmlhtml.cpp:155
void setEscapeStringCaseSensitive(bool val)
bool isEndTag(const char *eID=0) const
Definition: utilxml.cpp:323
void addTokenSubstitute(const char *findString, const char *replaceString)
void setEscapeEnd(const char *escEnd)
#define SWORD_NAMESPACE_END
Definition: defs.h:40