[sword-devel] filters

Terry Biggs sword-devel@crosswire.org
Thu, 18 Dec 2003 09:47:46 -0500


Troy help!

I'm trying to make footnotes in the gbfhtmlhref and thmlhtmlhref filters
look like the osis filter.

I put this code in the gbfhtmlhref filter and it worked as expected.


else if (!strncmp(token, "Rf", 2)) {
	buf += "<a href=\"note=";
	buf += u->lastTextNode.c_str();
	buf += "\">";
	buf += "<small><sup>*n</sup></small></a>";
	// let's let text resume to output again
	u->suspendTextPassThru = false;
}
else if (!strncmp(token, "RF", 2)) {
	if (u->hasFootnotePreTag) {
		u->hasFootnotePreTag = false;
		buf += "</i> ";
	}
	u->suspendTextPassThru = true;
}

I put this in the thmlhtmlhref filter and mostly u->lastTextNode is
empty. the footnotes are removed from the text but are not in
u->lastTextNode.


else if (tag.getName() && !strcmp(tag.getName(), "note")) {
	if (tag.isEndTag()) {
		buf += "<a href=\"note=";
		buf += u->lastTextNode.c_str();
		buf += "\">";
		buf += "<small><sup>*n</sup></small></a>";
		// let's let text resume to output again
		u->suspendTextPassThru = false;
	}
	else {
		// let's stop text from going to output
		u->suspendTextPassThru = true;
	}
}

thanks
Terry
--