summaryrefslogtreecommitdiff
path: root/src/modules/filters/teihtmlhref.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/teihtmlhref.cpp
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'src/modules/filters/teihtmlhref.cpp')
-rw-r--r--src/modules/filters/teihtmlhref.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/filters/teihtmlhref.cpp b/src/modules/filters/teihtmlhref.cpp
index 47bb7b9..43fe584 100644
--- a/src/modules/filters/teihtmlhref.cpp
+++ b/src/modules/filters/teihtmlhref.cpp
@@ -1,10 +1,10 @@
/***************************************************************************
- * teirtf.cpp - TEI to HTMLHREF filter
- * -------------------
- * begin : 2006-07-03
- * copyright : 2006 by CrossWire Bible Society
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * teihtmlhref.cpp - TEI to HTML with hrefs filter
+ *
+ * $Id: teihtmlhref.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ *
+ * Copyright 2008-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -35,8 +35,8 @@ SWORD_NAMESPACE_START
TEIHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
BiblicalText = false;
if (module) {
- version = module->Name();
- BiblicalText = (!strcmp(module->Type(), "Biblical Texts"));
+ version = module->getName();
+ BiblicalText = (!strcmp(module->getType(), "Biblical Texts"));
}
}
@@ -57,6 +57,8 @@ TEIHTMLHREF::TEIHTMLHREF() {
addAllowedEscapeString("gt");
setTokenCaseSensitive(true);
+
+ renderNoteNumbers = false;
}
bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
@@ -259,11 +261,13 @@ bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
}
if (tag.isEndTag()) {
SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
+ SWBuf noteName = tag.getAttribute("n");
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup class=\"n\">*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%s</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());
+ URL::encode(u->key->getText()).c_str(),
+ (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
u->suspendTextPassThru = false;
}