diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | src/modules/filters/gbfhtmlhref.cpp | 6 | ||||
-rw-r--r-- | src/modules/filters/gbfosis.cpp | 38 | ||||
-rw-r--r-- | src/modules/filters/thmlhtmlhref.cpp | 24 | ||||
-rw-r--r-- | src/modules/filters/thmlosis.cpp | 14 |
5 files changed, 77 insertions, 18 deletions
@@ -1,10 +1,17 @@ API ChangeLog (see the ChangeLog in each 'apps' directory for app specific changes + +29-Oct-2002 Troy A. Griffitts <scribe@crosswire.org> + Added SWModule *SWMgr::getModule(const char *modName); + Added Terry Biggs' patch to htmlref filters to + more consistently deal with strongs numbers + 23-Oct-2002 Daniel Glassey <dglassey@crosswire.org> - some base work for installmgr on classes to + Some base work for installmgr on classes to manage mods.d + * Release 1.5.5 * 22-Oct-2002 Troy A. Griffitts <scribe@crosswire.org> @@ -477,7 +484,7 @@ Kolatzek. gbfhtml.cpp: Changed the HTML tag for new paragraph from <P> to <BR> because it's bad HTML without a closing </P> tag. -23-Oct-2000 Joachim Ansorg <jansorg@crosswire.org> +23-Oct-2000 Joachim Ansorg <jansorg@crosswire.org> Changed the private section of versekey.h into a protected one because we need the change for current BibleTime! @@ -757,4 +764,4 @@ Kolatzek. Added chapmax and versemax information (canon.h) Made sword.cpp test program accept parameters: usage: sword ["Book CH:VS"] [number of verses to display] - enabled normalize function (try sword "Matthew 1:-7" 12) + Enabled normalize function (try sword "Matthew 1:-7" 12) diff --git a/src/modules/filters/gbfhtmlhref.cpp b/src/modules/filters/gbfhtmlhref.cpp index a49aad8..6232ff4 100644 --- a/src/modules/filters/gbfhtmlhref.cpp +++ b/src/modules/filters/gbfhtmlhref.cpp @@ -64,7 +64,7 @@ bool GBFHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &user if (!substituteToken(buf, token)) { if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers - pushString(buf, " <small><em><<a href=\"#"); + pushString(buf, " <small><em><<a href=\"type=Strongs value="); for (tok = token+1; *tok; tok++) //if(token[i] != '\"') *(*buf)++ = *tok; @@ -77,7 +77,7 @@ bool GBFHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &user } else if (!strncmp(token, "WTG", 3) || !strncmp(token, "WTH", 3)) { // strong's numbers tense - pushString(buf, " <small><em>(<A HREF=\"#"); + pushString(buf, " <small><em><<a href=\"type=Strongs value="); for (tok = token + 2; *tok; tok++) if(*tok != '\"') *(*buf)++ = *tok; @@ -90,7 +90,7 @@ bool GBFHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &user } else if (!strncmp(token, "WT", 2) && strncmp(token, "WTH", 3) && strncmp(token, "WTG", 3)) { // morph tags - pushString(buf, " <small><em>(<a href=\"M"); + pushString(buf, " <small><em>(<a href=\"type=morph class=none value="); for (tok = token + 2; *tok; tok++) if(*tok != '\"') *(*buf)++ = *tok; diff --git a/src/modules/filters/gbfosis.cpp b/src/modules/filters/gbfosis.cpp index 0d9f8f1..ac271c4 100644 --- a/src/modules/filters/gbfosis.cpp +++ b/src/modules/filters/gbfosis.cpp @@ -126,6 +126,18 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu lastspace = false; handled = true; } + // hebrew titles + if (!strcmp(token, "TH")) { + pushString(&to, "<title type=\"psalm\">"); + newText = true; + lastspace = false; + handled = true; + } + else if (!strcmp(token, "Th")) { + pushString(&to, "</title>"); + lastspace = false; + handled = true; + } // Italics assume transchange if (!strcmp(token, "FI")) { pushString(&to, "<transChange changeType=\"added\">"); @@ -140,7 +152,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu } // Paragraph break. For now use empty paragraph element if (!strcmp(token, "CM")) { - pushString(&to, "<p />"); + pushString(&to, "<milestone type=\"p\" />"); newText = true; lastspace = false; handled = true; @@ -176,6 +188,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu // Strongs numbers else if (*token == 'W' && (token[1] == 'G' || token[1] == 'H')) { // Strongs + bool divineName = false; if (module->isProcessEntryAttributes()) { valto = val; for (unsigned int i = 1; ((token[i]) && (i < 150)); i++) @@ -200,11 +213,22 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu to+=strlen(buf); } else { - sprintf(buf, "<w lemma=\"x-Strongs:%s\">", val); + if (!strcmp(val, "H03068")) { //divineName + sprintf(buf, "<divineName><w lemma=\"x-Strongs:%s\">", val); + divineName = true; + } + else sprintf(buf, "<w lemma=\"x-Strongs:%s\">", val); + memmove(wordStart+strlen(buf), wordStart, (to-wordStart)+1); memcpy(wordStart, buf, strlen(buf)); to+=strlen(buf); - pushString(&to, "</w>"); + + if (divineName) { + wordStart += 12; + pushString(&to, "</w></divineName>"); + } + else pushString(&to, "</w>"); + module->getEntryAttributes()["Word"][wordstr]["Strongs"] = val; lastspace = false; } @@ -298,8 +322,9 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu char ref[254]; if (vkey->Verse()) sprintf(ref, "\t\t<verse osisID=\"%s\">", vkey->getOSISRef()); - else if (vkey->Chapter()) + else if (vkey->Chapter()) { sprintf(ref, "\t<div type=\"chapter\" osisID=\"%s\">", vkey->getOSISRef()); + } else if (vkey->Book()) sprintf(ref, "\t<div type=\"book\" osisID=\"%s\">", vkey->getOSISRef()); else *ref = 0; @@ -334,9 +359,12 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu } } - else if (vkey->Chapter()) + /* + else if (vkey->Chapter()) { sprintf(ref, "\t<div type=\"chapter\" osisID=\"%s\">", vkey->getOSISRef()); + } else sprintf(ref, "\t<div type=\"book\" osisID=\"%s\">", vkey->getOSISRef()); + */ } } *to++ = 0; diff --git a/src/modules/filters/thmlhtmlhref.cpp b/src/modules/filters/thmlhtmlhref.cpp index 8e02944..e6247f3 100644 --- a/src/modules/filters/thmlhtmlhref.cpp +++ b/src/modules/filters/thmlhtmlhref.cpp @@ -140,23 +140,32 @@ bool ThMLHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &use if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution if (!strncmp(token, "sync ", 5)) { - pushString(buf, "<a href=\""); + if(strstr(token,"type=\"morph\"")){ + pushString(buf, "<small><em> (<a href=\""); + } + else + pushString(buf, "<small><em> <<a href=\""); for (tok = token + 5; *(tok+1); tok++) if(*tok != '\"') *(*buf)++ = *tok; - *(*buf)++ = '\"'; - *(*buf)++ = '>'; - + pushString(buf, "\">"); + //scan for value and add it to the buffer for (tok = token + 5; *tok; tok++) { if (!strncmp(tok, "value=\"", 7)) { - tok += 7; + if(strstr(token,"type=\"morph\"")) + tok += 7; + else + tok += 8; for (;*tok != '\"'; tok++) *(*buf)++ = *tok; break; } } - pushString(buf, "</a>"); + if(strstr(token,"type=\"morph\"")) + pushString(buf, "</a>) </em></small>"); + else + pushString(buf, "</a>> </em></small>"); } else if (!strncmp(token, "scripture ", 10)) { @@ -215,7 +224,7 @@ bool ThMLHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &use userData["SecHead"] = "false"; } } - +/* else if (!strncmp(token, "sync type=\"Strongs\" value=\"T", 28)) { pushString(buf, "<a href=\""); for (tok = token + 5; *(tok+1); tok++) @@ -228,6 +237,7 @@ bool ThMLHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &use *(*buf)++ = *tok; pushString(buf, "</a>"); } +*/ else if (!strncmp(token, "img ", 4)) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute diff --git a/src/modules/filters/thmlosis.cpp b/src/modules/filters/thmlosis.cpp index 3b50942..024c594 100644 --- a/src/modules/filters/thmlosis.cpp +++ b/src/modules/filters/thmlosis.cpp @@ -50,6 +50,7 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod bool suspendTextPassThru = false; bool keepToken = false; bool handled = false; + string divEnd = ""; len = strlen(text) + 1; // shift string to right of buffer if (len < maxlen) { @@ -93,6 +94,19 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod else break; } + // hebrew titles + if (!strcmp(token, "div class=\"sechead\"")) { + pushString(&to, "<title type=\"psalm\">"); + divEnd = "</title>"; + newText = true; + lastspace = false; + handled = true; + } + else if (!strcmp(token, "/div")) { + pushString(&to, divEnd.c_str()); + lastspace = false; + handled = true; + } // Scripture Reference if (!strncmp(token, "scripRef", 8)) { // pushString(buf, "<reference osisRef=\""); |