summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keys/versekey.cpp67
-rw-r--r--src/mgr/curlftpt.cpp3
-rw-r--r--src/mgr/versemgr.cpp12
-rw-r--r--src/modules/common/lzsscomprs.cpp4
-rw-r--r--src/modules/filters/gbfhtmlhref.cpp22
-rw-r--r--src/modules/filters/osishtmlhref.cpp64
-rw-r--r--src/modules/filters/teihtmlhref.cpp13
-rw-r--r--src/modules/filters/thmlhtmlhref.cpp14
-rw-r--r--src/modules/filters/utf8utf16.cpp1
-rw-r--r--src/modules/lexdict/zld/zld.cpp2
10 files changed, 128 insertions, 74 deletions
diff --git a/src/keys/versekey.cpp b/src/keys/versekey.cpp
index 1b055c8..9b75e97 100644
--- a/src/keys/versekey.cpp
+++ b/src/keys/versekey.cpp
@@ -563,6 +563,17 @@ ListKey VerseKey::ParseVerseList(const char *buf, const char *defaultKey, bool e
}
case '-':
+ if (chap == -1) {
+ book[tobook] = *buf;
+ book[tobook+1] = *(buf+1);
+ book[tobook+2] = 0;
+ int bookno = getBookAbbrev(book);
+ if (bookno > -1) {
+ tobook++;
+ buf++;
+ break;
+ }
+ }
case ',': // on number new verse
case ';': // on number new chapter
number[tonumber] = 0;
@@ -618,6 +629,9 @@ ListKey VerseKey::ParseVerseList(const char *buf, const char *defaultKey, bool e
strcpy(book, lastKey->getBookName());
}
bookno = getBookAbbrev(book);
+ if ((bookno > -1) && (suffix == 'f') && (book[strlen(book)-1] == 'f')) {
+ suffix = 0;
+ }
}
if (((bookno > -1) || (!*book)) && ((*book) || (chap >= 0) || (verse >= 0))) {
char partial = 0;
@@ -765,6 +779,8 @@ ListKey VerseKey::ParseVerseList(const char *buf, const char *defaultKey, bool e
default:
if (isdigit(*buf)) {
number[tonumber++] = *buf;
+ suffix = 0;
+ doubleF = 0;
}
else {
switch (*buf) {
@@ -843,6 +859,9 @@ ListKey VerseKey::ParseVerseList(const char *buf, const char *defaultKey, bool e
strcpy(book, lastKey->getBookName());
}
bookno = getBookAbbrev(book);
+ if ((bookno > -1) && (suffix == 'f') && (book[strlen(book)-1] == 'f')) {
+ suffix = 0;
+ }
}
if (((bookno > -1) || (!*book)) && ((*book) || (chap >= 0) || (verse >= 0))) {
char partial = 0;
@@ -938,7 +957,7 @@ ListKey VerseKey::ParseVerseList(const char *buf, const char *defaultKey, bool e
*curKey = MAXCHAPTER;
if (partial > 0)
*curKey = MAXVERSE;
- newElement->UpperBound(*curKey);
+ newElement->UpperBound(*curKey);
*newElement = TOP;
tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
}
@@ -966,10 +985,11 @@ VerseKey &VerseKey::LowerBound(const VerseKey &lb)
initBounds();
lowerBound = lb.Index();
- lowerBoundComponents.test = lb.getTestament();
- lowerBoundComponents.book = lb.getBook();
- lowerBoundComponents.chap = lb.getChapter();
- lowerBoundComponents.verse = lb.getVerse();
+ lowerBoundComponents.test = lb.getTestament();
+ lowerBoundComponents.book = lb.getBook();
+ lowerBoundComponents.chap = lb.getChapter();
+ lowerBoundComponents.verse = lb.getVerse();
+ lowerBoundComponents.suffix = lb.getSuffix();
// both this following check and UpperBound check force upperBound to
// change allowing LowerBound then UpperBound logic to always flow
@@ -990,10 +1010,11 @@ VerseKey &VerseKey::UpperBound(const VerseKey &ub)
initBounds();
upperBound = ub.Index();
- upperBoundComponents.test = ub.getTestament();
- upperBoundComponents.book = ub.getBook();
- upperBoundComponents.chap = ub.getChapter();
- upperBoundComponents.verse = ub.getVerse();
+ upperBoundComponents.test = ub.getTestament();
+ upperBoundComponents.book = ub.getBook();
+ upperBoundComponents.chap = ub.getChapter();
+ upperBoundComponents.verse = ub.getVerse();
+ upperBoundComponents.suffix = ub.getSuffix();
// see LowerBound comment, above
if (upperBound < lowerBound) upperBound = lowerBound;
@@ -1015,6 +1036,7 @@ VerseKey &VerseKey::LowerBound() const
tmpClone->book = lowerBoundComponents.book;
tmpClone->chapter = lowerBoundComponents.chap;
tmpClone->setVerse (lowerBoundComponents.verse);
+ tmpClone->setSuffix (lowerBoundComponents.suffix);
}
else tmpClone->Index(lowerBound);
@@ -1034,6 +1056,7 @@ VerseKey &VerseKey::UpperBound() const
tmpClone->book = upperBoundComponents.book;
tmpClone->chapter = upperBoundComponents.chap;
tmpClone->setVerse (upperBoundComponents.verse);
+ tmpClone->setSuffix (upperBoundComponents.suffix);
}
else tmpClone->Index(upperBound);
@@ -1064,16 +1087,18 @@ void VerseKey::initBounds() const
tmpClone->Chapter(tmpClone->getChapterMax());
tmpClone->Verse(tmpClone->getVerseMax());
upperBound = tmpClone->Index();
- upperBoundComponents.test = tmpClone->getTestament();
- upperBoundComponents.book = tmpClone->getBook();
- upperBoundComponents.chap = tmpClone->getChapter();
- upperBoundComponents.verse = tmpClone->getVerse();
+ upperBoundComponents.test = tmpClone->getTestament();
+ upperBoundComponents.book = tmpClone->getBook();
+ upperBoundComponents.chap = tmpClone->getChapter();
+ upperBoundComponents.verse = tmpClone->getVerse();
+ upperBoundComponents.suffix = tmpClone->getSuffix();
lowerBound = 0;
- lowerBoundComponents.test = 0;
- lowerBoundComponents.book = 0;
- lowerBoundComponents.chap = 0;
- lowerBoundComponents.verse = 0;
+ lowerBoundComponents.test = 0;
+ lowerBoundComponents.book = 0;
+ lowerBoundComponents.chap = 0;
+ lowerBoundComponents.verse = 0;
+ lowerBoundComponents.suffix = 0;
}
else tmpClone->setLocale(getLocale());
@@ -1403,8 +1428,8 @@ void VerseKey::setTestament(char itestament)
void VerseKey::setBook(char ibook)
{
- verse = ibook ? 1 : 0;
- chapter = ibook ? 1 : 0;
+ verse = 1;
+ chapter = 1;
book = ibook;
Normalize(1);
}
@@ -1440,9 +1465,11 @@ void VerseKey::setBookName(const char *bname)
void VerseKey::setChapter(int ichapter)
{
- verse = ichapter ? 1 : 0;
+ verse = 1;
chapter = ichapter;
Normalize(1);
+ // TODO: easiest fix, but should be in Normalize
+ verse = 1;
}
diff --git a/src/mgr/curlftpt.cpp b/src/mgr/curlftpt.cpp
index 0f7231a..7d2fd3c 100644
--- a/src/mgr/curlftpt.cpp
+++ b/src/mgr/curlftpt.cpp
@@ -177,6 +177,9 @@ char CURLFTPTransport::getURL(const char *destPath, const char *sourceURL, SWBuf
res = curl_easy_perform(session);
SWLog::getSystemLog()->logDebug("***** Finished performing curl easy action. \n");
+ // it seems CURL tries to use this option data later for some reason, so we unset here
+ curl_easy_setopt(session, CURLOPT_PROGRESSDATA, (void*)NULL);
+
if(CURLE_OK != res) {
retVal = -1;
}
diff --git a/src/mgr/versemgr.cpp b/src/mgr/versemgr.cpp
index 90c2415..354c0df 100644
--- a/src/mgr/versemgr.cpp
+++ b/src/mgr/versemgr.cpp
@@ -4,7 +4,7 @@
*
* $Id: versemgr.cpp 2108 2007-10-13 20:35:02Z scribe $
*
- * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2010 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -34,11 +34,14 @@
#include <canon_mt.h> // Masoretic Text (MT) v11n system
#include <canon_kjva.h> // KJV + Apocrypha v11n system
#include <canon_nrsv.h> // NRSV v11n system
-#include <canon_nrsva.h> // NRSVA + Apocrypha v11n system
+#include <canon_nrsva.h> // NRSV + Apocrypha v11n system
#include <canon_synodal.h> // Russian Synodal v11n system
#include <canon_vulg.h> // Vulgate v11n system
#include <canon_german.h> // German v11n system
#include <canon_luther.h> // Luther v11n system
+#include <canon_catholic.h> // Catholic v11n system (10 chapter Esther)
+#include <canon_catholic2.h> // Catholic2 v11n system (16 chapter Esther)
+#include <canon_synodalp.h> // SynodalP v11n system (KJV with Synodal-like verse counts)
using std::vector;
using std::map;
@@ -59,8 +62,11 @@ VerseMgr *VerseMgr::getSystemVerseMgr() {
systemVerseMgr->registerVersificationSystem("NRSVA", otbooks_nrsva, ntbooks, vm_nrsva);
systemVerseMgr->registerVersificationSystem("Synodal", otbooks_synodal, ntbooks_synodal, vm_synodal);
systemVerseMgr->registerVersificationSystem("Vulg", otbooks_vulg, ntbooks_vulg, vm_vulg);
- systemVerseMgr->registerVersificationSystem("German", otbooks_german, ntbooks_german, vm_german);
+ systemVerseMgr->registerVersificationSystem("German", otbooks_german, ntbooks, vm_german);
systemVerseMgr->registerVersificationSystem("Luther", otbooks_luther, ntbooks_luther, vm_luther);
+ systemVerseMgr->registerVersificationSystem("Catholic", otbooks_catholic, ntbooks, vm_catholic);
+ systemVerseMgr->registerVersificationSystem("Catholic2", otbooks_catholic2, ntbooks, vm_catholic2);
+ systemVerseMgr->registerVersificationSystem("SynodalP", otbooks, ntbooks, vm_synodalp);
}
return systemVerseMgr;
}
diff --git a/src/modules/common/lzsscomprs.cpp b/src/modules/common/lzsscomprs.cpp
index 00177db..624942d 100644
--- a/src/modules/common/lzsscomprs.cpp
+++ b/src/modules/common/lzsscomprs.cpp
@@ -618,9 +618,9 @@ void LZSSCompress::Decode(void)
break;
if (SendChars((char *) c, 1) != 1) {
- totalLen++;
break;
}
+ totalLen++;
// Add to buffer, and increment to next spot. Wrap at end.
@@ -673,9 +673,9 @@ void LZSSCompress::Decode(void)
// Add the "len" :characters to the output stream.
if (SendChars((char *) c, len) != (unsigned int)len) {
- totalLen += len;
break;
}
+ totalLen += len;
}
}
slen = totalLen;
diff --git a/src/modules/filters/gbfhtmlhref.cpp b/src/modules/filters/gbfhtmlhref.cpp
index b4cdde0..3f25e3a 100644
--- a/src/modules/filters/gbfhtmlhref.cpp
+++ b/src/modules/filters/gbfhtmlhref.cpp
@@ -155,11 +155,11 @@ bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
// else
if (!strncmp(token, "WG", 2)) { // strong's numbers
//buf += " <small><em>&lt;<a href=\"type=Strongs value=";
- buf += " <small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
+ buf += " <small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
for (tok = token+2; *tok; tok++)
//if(token[i] != '\"')
buf += *tok;
- buf += "\">";
+ buf += "\" class=\"strongs\">";
for (tok = token + 2; *tok; tok++)
//if(token[i] != '\"')
buf += *tok;
@@ -167,11 +167,11 @@ bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
}
else if (!strncmp(token, "WH", 2)) { // strong's numbers
//buf += " <small><em>&lt;<a href=\"type=Strongs value=";
- buf += " <small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
+ buf += " <small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
for (tok = token+2; *tok; tok++)
//if(token[i] != '\"')
buf += *tok;
- buf += "\">";
+ buf += "\" class=\"strongs\">";
for (tok = token + 2; *tok; tok++)
//if(token[i] != '\"')
buf += *tok;
@@ -179,11 +179,11 @@ bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
}
else if (!strncmp(token, "WTG", 3)) { // strong's numbers tense
//buf += " <small><em>(<a href=\"type=Strongs value=";
- buf += " <small><em>(<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
+ buf += " <small><em class=\"strongs\">(<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
for (tok = token + 3; *tok; tok++)
if(*tok != '\"')
buf += *tok;
- buf += "\">";
+ buf += "\" class=\"strongs\">";
for (tok = token + 3; *tok; tok++)
if(*tok != '\"')
buf += *tok;
@@ -191,11 +191,11 @@ bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
}
else if (!strncmp(token, "WTH", 3)) { // strong's numbers tense
//buf += " <small><em>(<a href=\"type=Strongs value=";
- buf += " <small><em>(<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
+ buf += " <small><em class=\"strongs\">(<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
for (tok = token + 3; *tok; tok++)
if(*tok != '\"')
buf += *tok;
- buf += "\">";
+ buf += "\" class=\"strongs\">";
for (tok = token + 3; *tok; tok++)
if(*tok != '\"')
buf += *tok;
@@ -204,12 +204,12 @@ bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
else if (!strncmp(token, "WT", 2) && strncmp(token, "WTH", 3) && strncmp(token, "WTG", 3)) { // morph tags
//buf += " <small><em>(<a href=\"type=morph class=none value=";
- buf += " <small><em>(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=";
+ buf += " <small><em class=\"morph\">(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=";
for (tok = token + 2; *tok; tok++)
if(*tok != '\"')
buf += *tok;
- buf += "\">";
+ buf += "\" class=\"morph\">";
for (tok = token + 2; *tok; tok++)
if(*tok != '\"')
buf += *tok;
@@ -240,7 +240,7 @@ bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
//char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup>*n</sup></small></a> ",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup class=\"n\">*n</sup></small></a> ",
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(vkey->getText()).c_str());
diff --git a/src/modules/filters/osishtmlhref.cpp b/src/modules/filters/osishtmlhref.cpp
index bdabd83..3406e1b 100644
--- a/src/modules/filters/osishtmlhref.cpp
+++ b/src/modules/filters/osishtmlhref.cpp
@@ -34,14 +34,21 @@
SWORD_NAMESPACE_START
-class OSISHTMLHREF::QuoteStack : public std::stack<char *> {
+namespace {
+ typedef std::stack<SWBuf> TagStack;
+}
+
+// TODO: this bridge pattern is to preserve binary compat on 1.6.x
+class OSISHTMLHREF::TagStacks {
+public:
+ TagStack quoteStack;
+ TagStack hiStack;
};
OSISHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
- inBold = false;
inXRefNote = false;
suspendLevel = 0;
- quoteStack = new QuoteStack();
+ tagStacks = new TagStacks();
wordsOfChristStart = "<font color=\"red\"> ";
wordsOfChristEnd = "</font> ";
if (module) {
@@ -56,13 +63,7 @@ OSISHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) :
}
OSISHTMLHREF::MyUserData::~MyUserData() {
- // Just in case the quotes are not well formed
- while (!quoteStack->empty()) {
- char *tagData = quoteStack->top();
- quoteStack->pop();
- delete [] tagData;
- }
- delete quoteStack;
+ delete tagStacks;
}
OSISHTMLHREF::OSISHTMLHREF() {
@@ -117,7 +118,7 @@ void processLemma(bool suspendTextPassThru, XMLTag &tag, SWBuf &buf) {
// show = false;
//else {
if (!suspendTextPassThru) {
- buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\">%s</a>&gt;</em></small>",
+ buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\" class=\"strongs\">%s</a>&gt;</em></small>",
(gh.length()) ? gh.c_str() : "",
URL::encode(val2).c_str(),
val2);
@@ -147,7 +148,7 @@ void processMorph(bool suspendTextPassThru, XMLTag &tag, SWBuf &buf) {
if ((*val == 'T') && (strchr("GH", val[1])) && (isdigit(val[2])))
val2+=2;
if (!suspendTextPassThru) {
- buf.appendFormatted("<small><em>(<a href=\"passagestudy.jsp?action=showMorph&type=%s&value=%s\">%s</a>)</em></small>",
+ buf.appendFormatted("<small><em class=\"morph\">(<a href=\"passagestudy.jsp?action=showMorph&type=%s&value=%s\" class=\"morph\">%s</a>)</em></small>",
URL::encode(tag.getAttribute("morph")).c_str(),
URL::encode(val).c_str(),
val2);
@@ -252,19 +253,21 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
SWCATCH ( ... ) { }
if (vkey) {
//printf("URL = %s\n",URL::encode(vkey->getText()).c_str());
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>",
ch,
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(vkey->getText()).c_str(),
+ ch,
ch);
}
else {
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>",
ch,
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(u->key->getText()).c_str(),
+ ch,
ch);
}
}
@@ -386,12 +389,15 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
// <milestone type="x-p"/>
// <milestone type="cQuote" marker="x"/>
else if ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type"))) {
- if(!strcmp(tag.getAttribute("type"), "line")) {
+ if (!strcmp(tag.getAttribute("type"), "line")) {
outText("<br />", buf, u);
+ if (tag.getAttribute("subType") && !strcmp(tag.getAttribute("subType"), "x-PM")) {
+ outText("<br />", buf, u);
+ }
userData->supressAdjacentWhitespace = true;
}
- else if(!strcmp(tag.getAttribute("type"),"x-p")) {
- if( tag.getAttribute("marker"))
+ else if (!strcmp(tag.getAttribute("type"),"x-p")) {
+ if (tag.getAttribute("marker"))
outText(tag.getAttribute("marker"), buf, u);
else outText("<!p>", buf, u);
}
@@ -482,17 +488,21 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
if (type == "bold" || type == "b" || type == "x-b") {
outText("<b>", buf, u);
- u->inBold = true;
}
else { // all other types
outText("<i>", buf, u);
- u->inBold = false;
}
+ u->tagStacks->hiStack.push(tag.toString());
}
else if (tag.isEndTag()) {
- if(u->inBold) {
+ SWBuf type = "";
+ if (!u->tagStacks->hiStack.empty()) {
+ XMLTag tag(u->tagStacks->hiStack.top());
+ u->tagStacks->hiStack.pop();
+ type = tag.getAttribute("type");
+ }
+ if (type == "bold" || type == "b" || type == "x-b") {
outText("</b>", buf, u);
- u->inBold = false;
}
else outText("</i>", buf, u);
}
@@ -519,9 +529,7 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
if ((!tag.isEmpty() && !tag.isEndTag()) || (tag.isEmpty() && tag.getAttribute("sID"))) {
// if <q> then remember it for the </q>
if (!tag.isEmpty()) {
- char *tagData = 0;
- stdstr(&tagData, tag.toString());
- u->quoteStack->push(tagData);
+ u->tagStacks->quoteStack.push(tag.toString());
}
// Do this first so quote marks are included as WoC
@@ -538,11 +546,9 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
// close </q> or <q eID... />
else if ((tag.isEndTag()) || (tag.isEmpty() && tag.getAttribute("eID"))) {
// if it is </q> then pop the stack for the attributes
- if (tag.isEndTag() && !u->quoteStack->empty()) {
- char *tagData = u->quoteStack->top();
- u->quoteStack->pop();
- XMLTag qTag(tagData);
- delete [] tagData;
+ if (tag.isEndTag() && !u->tagStacks->quoteStack.empty()) {
+ XMLTag qTag(u->tagStacks->quoteStack.top());
+ u->tagStacks->quoteStack.pop();
type = qTag.getAttribute("type");
who = qTag.getAttribute("who");
diff --git a/src/modules/filters/teihtmlhref.cpp b/src/modules/filters/teihtmlhref.cpp
index 7e27667..47bb7b9 100644
--- a/src/modules/filters/teihtmlhref.cpp
+++ b/src/modules/filters/teihtmlhref.cpp
@@ -55,7 +55,7 @@ TEIHTMLHREF::TEIHTMLHREF() {
addAllowedEscapeString("amp");
addAllowedEscapeString("lt");
addAllowedEscapeString("gt");
-
+
setTokenCaseSensitive(true);
}
@@ -87,6 +87,8 @@ bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
u->lastHi = rend;
if (rend == "ital")
buf += "<i>";
+ else if (rend == "italic")
+ buf += "<i>";
else if (rend == "bold")
buf += "<b>";
else if (rend == "sup")
@@ -97,6 +99,8 @@ bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
SWBuf rend = u->lastHi;
if (rend == "ital")
buf += "</i>";
+ else if (rend == "italic")
+ buf += "</i>";
else if (rend == "bold")
buf += "</b>";
else if (rend == "sup")
@@ -138,6 +142,11 @@ bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
}
}
+ // <lb.../>
+ else if (!strcmp(tag.getName(), "lb")) {
+ buf += "<br />";
+ }
+
// <pos>, <gen>, <case>, <gram>, <number>, <mood>, <pron>, <def>
else if (!strcmp(tag.getName(), "pos") ||
!strcmp(tag.getName(), "gen") ||
@@ -251,7 +260,7 @@ bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
if (tag.isEndTag()) {
SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup>*n</sup></small></a>",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup class=\"n\">*n</sup></small></a>",
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(u->key->getText()).c_str());
diff --git a/src/modules/filters/thmlhtmlhref.cpp b/src/modules/filters/thmlhtmlhref.cpp
index 83f5a80..c0887f1 100644
--- a/src/modules/filters/thmlhtmlhref.cpp
+++ b/src/modules/filters/thmlhtmlhref.cpp
@@ -175,21 +175,21 @@ bool ThMLHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
SWBuf value = tag.getAttribute("value");
if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "morph")) { //&gt;
if(value.length())
- buf.appendFormatted("<small><em>(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=%s\">%s</a>)</em></small>",
+ buf.appendFormatted("<small><em class=\"morph\">(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=%s\" class=\"morph\">%s</a>)</em></small>",
URL::encode(value.c_str()).c_str(),
value.c_str());
}
else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "lemma")) { //&gt;
if(value.length())
// empty "type=" is deliberate.
- buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=&value=%s\">%s</a>&gt;</em></small>",
+ buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=&value=%s\" class=\"strongs\">%s</a>&gt;</em></small>",
URL::encode(value.c_str()).c_str(),
value.c_str());
}
else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
char ch = *value;
value<<1;
- buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\">",
+ buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\" class=\"strongs\">",
((ch == 'H') ? "Hebrew" : "Greek"),
URL::encode(value.c_str()).c_str());
buf += (value.length()) ? value.c_str() : "";
@@ -215,20 +215,22 @@ bool ThMLHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>",
ch,
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(vkey->getText()).c_str(),
+ ch,
ch);
}
else {
char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>",
ch,
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(u->key->getText()).c_str(),
+ ch,
ch);
}
u->suspendTextPassThru = true;
@@ -272,7 +274,7 @@ bool ThMLHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
//buf.appendFormatted("<a href=\"noteID=%s.x.%s\"><small><sup>*x</sup></small></a> ", vkey->getText(), footnoteNumber.c_str());
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=x&value=%s&module=%s&passage=%s\"><small><sup>*x</sup></small></a>",
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=x&value=%s&module=%s&passage=%s\"><small><sup class=\"x\">*x</sup></small></a>",
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(vkey->getText()).c_str());
diff --git a/src/modules/filters/utf8utf16.cpp b/src/modules/filters/utf8utf16.cpp
index a770d5f..e5b96d7 100644
--- a/src/modules/filters/utf8utf16.cpp
+++ b/src/modules/filters/utf8utf16.cpp
@@ -63,6 +63,7 @@ char UTF8UTF16::processText(SWBuf &text, const SWKey *key, const SWModule *modul
}
text.setSize(text.size()+2);
*((__u16 *)(text.getRawData()+(text.size()-2))) = (__u16)0;
+ text.setSize(text.size()-2);
return 0;
diff --git a/src/modules/lexdict/zld/zld.cpp b/src/modules/lexdict/zld/zld.cpp
index 4e786bc..2c46657 100644
--- a/src/modules/lexdict/zld/zld.cpp
+++ b/src/modules/lexdict/zld/zld.cpp
@@ -48,7 +48,7 @@ zLD::zLD(const char *ipath, const char *iname, const char *idesc, long blockCoun
*/
zLD::~zLD() {
-
+ flushCache();
}