[sword-cvs] sword/src/modules/filters gbfhtmlhref.cpp,1.22,1.23 gbffootnotes.cpp,1.21,1.22
sword@www.crosswire.org
sword@www.crosswire.org
Mon, 22 Dec 2003 13:06:37 -0700
Update of /usr/local/cvsroot/sword/src/modules/filters
In directory www:/tmp/cvs-serv4266
Modified Files:
gbfhtmlhref.cpp gbffootnotes.cpp
Log Message:
work on footnotes
Index: gbfhtmlhref.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/gbfhtmlhref.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- gbfhtmlhref.cpp 22 Dec 2003 18:49:53 -0000 1.22
+++ gbfhtmlhref.cpp 22 Dec 2003 20:06:35 -0000 1.23
@@ -31,7 +31,7 @@
setTokenCaseSensitive(true);
//addTokenSubstitute("Rf", ")</small></font>");
- addTokenSubstitute("FA", "<font color=\"#800000\">");
+ addTokenSubstitute("FA", "<font color=\"#800000\">"); // for ASV footnotes to mark text
addTokenSubstitute("Rx", "</a>");
addTokenSubstitute("FI", "<i>"); // italics begin
addTokenSubstitute("Fi", "</i>");
@@ -153,7 +153,7 @@
buf += "</a>)</em></small>";
}
- else if (!strncmp(token, "RX", 2)) {
+ else if (!strcmp(tag.getName(), "RX")) {
buf += "<a href=\"";
for (tok = token + 3; *tok; tok++) {
if(*tok != '<' && *tok+1 != 'R' && *tok+2 != 'x') {
@@ -166,29 +166,25 @@
buf += "\">";
}
else if (!strcmp(tag.getName(), "RF")) {
- if (!tag.isEndTag()) {
- if (!tag.isEmpty()) {
- SWBuf type = tag.getAttribute("type");
- SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
- VerseKey *vkey;
- // see if we have a VerseKey * or descendant
- try {
- vkey = SWDYNAMIC_CAST(VerseKey, u->key);
- }
- catch ( ... ) { }
- 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=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), ch, footnoteNumber.c_str(), ch);
- }
- u->suspendTextPassThru = true;
- }
+ SWBuf type = tag.getAttribute("type");
+ SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
+ VerseKey *vkey;
+ // see if we have a VerseKey * or descendant
+ try {
+ vkey = SWDYNAMIC_CAST(VerseKey, u->key);
}
+ catch ( ... ) { }
+ 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=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), 'n', footnoteNumber.c_str(), 'n');
+ }
+ u->suspendTextPassThru = true;
}
-/* else if (!strcmp(tag.getName(), "Rf")) {
+ else if (!strcmp(tag.getName(), "Rf")) {
u->suspendTextPassThru = false;
}
-
+/*
else if (!strncmp(token, "RB", 2)) {
buf += "<i> ";
u->hasFootnotePreTag = true;
Index: gbffootnotes.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/gbffootnotes.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gbffootnotes.cpp 22 Dec 2003 18:49:53 -0000 1.21
+++ gbffootnotes.cpp 22 Dec 2003 20:06:35 -0000 1.22
@@ -61,20 +61,16 @@
XMLTag tag(token);
if (!strcmp(tag.getName(), "RF")) {
- if (!tag.isEndTag()) {
- if (!tag.isEmpty()) {
- refs = "";
- startTag = tag;
- hide = true;
- tagText = "";
- continue;
- }
- }
+ refs = "";
+ startTag = tag;
+ hide = true;
+ tagText = "";
+ continue;
}
else if (!strcmp(tag.getName(), "Rf")) {
if (module->isProcessEntryAttributes()) {
if(tagText.length() == 1) {
- if (option) {
+ if (option) { // for ASV marks text in verse then put explanation at end of verse
text += " <FA>(";
text.append(tagText);
text += ")<Fr>";
@@ -92,11 +88,6 @@
}
module->getEntryAttributes()["Footnote"][buf]["body"] = tagText;
startTag.setAttribute("swordFootnote", buf);
- if ((startTag.getAttribute("type")) && (!strcmp(startTag.getAttribute("type"), "crossReference"))) {
- if (!refs.length())
- refs = parser.ParseVerseList(tagText.c_str(), parser, true).getRangeText();
- module->getEntryAttributes()["Footnote"][buf]["refList"] = refs.c_str();
- }
}
hide = false;
if (option) {