summaryrefslogtreecommitdiff
path: root/src/modules/filters/osiswebif.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
commit7a00574163029c0c2b649878c95d5acbd083564a (patch)
treec13cc5736025834df2874ed87ee8598070025ea6 /src/modules/filters/osiswebif.cpp
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'src/modules/filters/osiswebif.cpp')
-rw-r--r--src/modules/filters/osiswebif.cpp60
1 files changed, 10 insertions, 50 deletions
diff --git a/src/modules/filters/osiswebif.cpp b/src/modules/filters/osiswebif.cpp
index e313836..2cbca0b 100644
--- a/src/modules/filters/osiswebif.cpp
+++ b/src/modules/filters/osiswebif.cpp
@@ -1,11 +1,11 @@
/***************************************************************************
- * OSISWEBIF.cpp - OSIS to HTML filter with hrefs
- * for strongs and morph tags
- * -------------------
- * begin : 2003-10-23
- * copyright : 2003 by CrossWire Bible Society
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * osiswebif.cpp - OSIS to HTML filter with hrefs for strongs and
+ * morph tags
+ *
+ * $Id: osiswebif.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ *
+ * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -37,20 +37,13 @@ OSISWEBIF::OSISWEBIF() : baseURL(""), passageStudyURL(baseURL + "passagestudy.js
}
-BasicFilterUserData *OSISWEBIF::createUserData(const SWModule *module, const SWKey *key) {
- MyUserData *u = new MyUserData(module, key);
- u->wordsOfChristStart = "<span class=\"wordsOfJesus\"> ";
- u->wordsOfChristEnd = "</span> ";
- return u;
-}
-
-
bool OSISWEBIF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
MyUserData *u = (MyUserData *)userData;
SWBuf scratch;
bool sub = (u->suspendTextPassThru) ? substituteToken(scratch, token) : substituteToken(buf, token);
if (!sub) {
- // manually process if it wasn't a simple substitution
+
+ // manually process if it wasn't a simple substitution
XMLTag tag(token);
// <w> tag
@@ -143,7 +136,7 @@ bool OSISWEBIF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
if (!tag.isEmpty()) {
if (!strongsMarkup) { // leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
- SWBuf modName = (u->module) ? u->module->Name() : "";
+ SWBuf modName = (u->module) ? u->module->getName() : "";
VerseKey *vkey = NULL;
// see if we have a VerseKey * or descendant
SWTRY {
@@ -165,43 +158,10 @@ bool OSISWEBIF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
}
}
- // <title>
- else if (!strcmp(tag.getName(), "title")) {
- if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "<h3>";
- }
- else if (tag.isEndTag()) {
- buf += "</h3>";
- }
- }
-
- // Milestoned paragraphs, created by osis2mod
- // <div type="paragraph" sID.../>
- // <div type="paragraph" eID.../>
- else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "paragraph")) {
- // This is properly handled by base class.
- return OSISHTMLHREF::handleToken(buf, token, userData);
- }
-
- // ok to leave these in
- else if (!strcmp(tag.getName(), "div")) {
- buf += tag;
- }
- else if (!strcmp(tag.getName(), "span")) {
- buf += tag;
- }
- else if (!strcmp(tag.getName(), "br")) {
- buf += tag;
- }
// handled appropriately in base class
- // <catchWord> & <rdg> tags (italicize)
- // <hi> text highlighting
- // <q> quote
- // <milestone type="cQuote" marker="x"/>
- // <transChange>
else {
- return OSISHTMLHREF::handleToken(buf, token, userData);
+ return OSISXHTML::handleToken(buf, token, userData);
}
}
return true;