diff options
Diffstat (limited to 'src/modules/filters/teihtmlhref.cpp')
-rw-r--r-- | src/modules/filters/teihtmlhref.cpp | 22 |
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; } |