[sword-svn] r3402 - trunk/src/modules/filters
refdoc at crosswire.org
refdoc at crosswire.org
Tue Feb 9 00:18:54 MST 2016
Author: refdoc
Date: 2016-02-09 00:18:54 -0700 (Tue, 09 Feb 2016)
New Revision: 3402
Modified:
trunk/src/modules/filters/osishtmlhref.cpp
trunk/src/modules/filters/osislatex.cpp
trunk/src/modules/filters/osisxhtml.cpp
Log:
fixed wrong use of output methods. Fixed CSS + code for "colophons". fixed transChange CSS
Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp 2016-02-06 17:12:20 UTC (rev 3401)
+++ trunk/src/modules/filters/osishtmlhref.cpp 2016-02-09 07:18:54 UTC (rev 3402)
@@ -595,7 +595,7 @@
if ((type == "added") || (type == "supplied"))
outText("<i>", buf, u);
else if (type == "tenseChange")
- buf += "*";
+ outText( "*", buf, u);
}
else if (tag.isEndTag()) {
SWBuf type = u->lastTransChange;
Modified: trunk/src/modules/filters/osislatex.cpp
===================================================================
--- trunk/src/modules/filters/osislatex.cpp 2016-02-06 17:12:20 UTC (rev 3401)
+++ trunk/src/modules/filters/osislatex.cpp 2016-02-09 07:18:54 UTC (rev 3402)
@@ -306,7 +306,7 @@
SWCATCH ( ... ) { }
if (vkey) {
//printf("URL = %s\n",URL::encode(vkey->getText()).c_str());
- buf.appendFormatted("\\swordfootnote{%s}{%s}{%s}{%s}(%s){",
+ buf.appendFormatted("\\swordfootnote{%s}{%s}{%s}{%s}{%s}{",
footnoteNumber.c_str(),
u->version.c_str(),
@@ -314,7 +314,7 @@
tag.getAttribute("type"),
(renderNoteNumbers ? noteName.c_str() : ""));
if (u->module) {
- buf += u->module->renderText(footnoteBody).c_str();
+ outText( u->module->renderText(footnoteBody).c_str(), buf, u);
}
}
else {
@@ -325,7 +325,7 @@
tag.getAttribute("type"),
(renderNoteNumbers ? noteName.c_str() : ""));
if (u->module) {
- buf += u->module->renderText(footnoteBody).c_str();
+ outText( u->module->renderText(footnoteBody).c_str(), buf, u);
}
}
}
@@ -336,7 +336,7 @@
u->suspendTextPassThru = (--u->suspendLevel);
u->inXRefNote = false;
u->lastSuspendSegment = ""; // fix/work-around for nasb divineName in note bug
- buf +="}";
+ outText("}", buf, u);
}
}
@@ -493,7 +493,7 @@
outText("}{", buf, u);
}
else if (tag.isEndTag()) {
- buf += "}";
+ outText( "}", buf, u);
++u->consecutiveNewlines;
u->supressAdjacentWhitespace = true;
}
@@ -534,7 +534,7 @@
// divineName
else if (!strcmp(tag.getName(), "divineName")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "\\sworddivinename{";
+ outText( "\\sworddivinename{", buf, u);
u->suspendTextPassThru = (++u->suspendLevel);
}
else if (tag.isEndTag()) {
@@ -658,7 +658,7 @@
if ((type == "added") || (type == "supplied"))
outText("\\swordtranschange{supplied}{", buf, u);
else if (type == "tenseChange")
- buf += "\\swordtranschange{tense}{";
+ outText( "\\swordtranschange{tense}{", buf, u);
}
else if (tag.isEndTag()) {
outText("}", buf, u);
@@ -692,45 +692,45 @@
SWBuf type = tag.getAttribute("type");
if (type == "module") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
else if (type == "testament") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
else if (type == "bookGroup") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
else if (type == "book") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
else if (type == "majorSection") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
else if (type == "section") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
else if (type == "paragraph") {
u->divLevel = type;
- buf +="\n";
+ outText("\n", buf, u);
}
}
else if (!strcmp(tag.getName(), "span")) {
- buf += "";
+ outText( "", buf, u);
}
else if (!strcmp(tag.getName(), "br")) {
- buf += "\\";
+ outText( "\\", buf, u);
}
else if (!strcmp(tag.getName(), "table")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "\n\\begin{tabular}";
+ outText( "\n\\begin{tabular}", buf, u);
}
else if (tag.isEndTag()) {
- buf += "\n\\end{tabular}";
+ outText( "\n\\end{tabular}", buf, u);
++u->consecutiveNewlines;
u->supressAdjacentWhitespace = true;
}
@@ -738,11 +738,11 @@
}
else if (!strcmp(tag.getName(), "row")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "\n";
+ outText( "\n", buf, u);
u->firstCell = true;
}
else if (tag.isEndTag()) {
- buf += "//";
+ outText( "//", buf, u);
u->firstCell = false;
}
@@ -750,14 +750,14 @@
else if (!strcmp(tag.getName(), "cell")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
if (u->firstCell == false) {
- buf += " & ";
+ outText( " & ", buf, u);
}
else {
u->firstCell = false;
}
}
else if (tag.isEndTag()) {
- buf += "";
+ outText( "", buf, u);
}
}
else {
Modified: trunk/src/modules/filters/osisxhtml.cpp
===================================================================
--- trunk/src/modules/filters/osisxhtml.cpp 2016-02-06 17:12:20 UTC (rev 3401)
+++ trunk/src/modules/filters/osisxhtml.cpp 2016-02-09 07:18:54 UTC (rev 3402)
@@ -38,6 +38,8 @@
.divineName { font-variant: small-caps; }\n\
.wordsOfJesus { color: red; }\n\
.transChange { font-style: italic;}\n\
+ .transChange[type=tenseChange]::before { content: '|'; vertical-align:sub; font-size: 0.75em; color: red;}\n\
+ .transChange[type=tenseChange]::after { content: '|'; vertical-align:sub; font-size: 0.75em; color: red;}\n\
.overline { text-decoration: overline; }\n\
.indent1 { margin-left: 10px }\n\
.indent2 { margin-left: 20px }\n\
@@ -47,7 +49,7 @@
.small-caps { font-variant: small-caps; }\n\
.selah { text-align: right; width: 50%; margin: 0; padding: 0; }\n\
.acrostic { text-align: center; }\n\
- .colophon {display:block;}\n\
+ .colophon {font-style: italic; font-size=small; display:block;}\n\
.rdg { font-style: italic;}\n\
.catchWord {font-style: bold;}\n\
";
@@ -261,7 +263,7 @@
}
/*if (endTag)
- buf += "}";*/
+ outText( "}", buf, u);*/
}
}
@@ -342,10 +344,18 @@
// <div type="paragraph" sID... />
if (tag.getAttribute("sID")) { // non-empty start tag
u->outputNewline(buf);
+ if (!strcmp(tag.getAttribute("type"), "colophon")) {
+ outText("<div class=\"colophon\">", buf, u);
+ }
+
}
// <div type="paragraph" eID... />
else if (tag.getAttribute("eID")) {
u->outputNewline(buf);
+ if (!strcmp(tag.getAttribute("type"), "colophon")) {
+ outText("</div>", buf, u);
+ }
+
}
}
@@ -484,21 +494,21 @@
if (!vkey->getChapter()) {
if (!vkey->getBook()) {
if (!vkey->getTestament()) {
- buf += SWBuf("<h1 class=\"moduleHeader ") + (keepType ? type : "") + "\">";
+ outText(SWBuf("<h1 class=\"moduleHeader ") + (keepType ? type : "") + "\">", buf, u);
tag.setAttribute("pushed", "h1");
}
else {
- buf += SWBuf("<h1 class=\"testamentHeader ") + (keepType ? type : "") + "\">";
+ outText(SWBuf("<h1 class=\"testamentHeader ") + (keepType ? type : "") + "\">", buf, u);
tag.setAttribute("pushed", "h1");
}
}
else {
- buf += SWBuf("<h1 class=\"bookHeader ") + (keepType ? type : "") + "\">";
+ outText(SWBuf("<h1 class=\"bookHeader ") + (keepType ? type : "") + "\">", buf, u);
tag.setAttribute("pushed", "h1");
}
}
else {
- buf += SWBuf("<h2 class=\"chapterHeader ") + (keepType ? type : "") + "\">";
+ outText(SWBuf("<h2 class=\"chapterHeader ") + (keepType ? type : "") + "\">", buf, u);
tag.setAttribute("pushed", "h2");
}
}
@@ -514,10 +524,10 @@
if (u->titleStack->size()) u->titleStack->pop();
SWBuf pushed = tag.getAttribute("pushed");
if (pushed.size()) {
- buf += (SWBuf)"</" + pushed + ">\n\n";
+ outText((SWBuf)"</" + pushed + ">\n\n", buf, u);
}
else {
- buf += "</h3>\n\n";
+ outText( "</h3>\n\n", buf, u);
}
++u->consecutiveNewlines;
u->supressAdjacentWhitespace = true;
@@ -709,9 +719,9 @@
outText("<span class=\"transChange\"", buf, u);
if (type) {
- buf += " type=\"";
- buf += type;
- buf += "\"";
+ outText( " type=\"", buf, u);
+ outText( type, buf, u);
+ outText( "\"", buf, u);
}
outText(">", buf, u);
}
@@ -762,40 +772,40 @@
}
else if ((!tag.isEndTag()) && (!tag.isEmpty())) {
SWBuf type = tag.getAttribute("type");
- buf += "<div class=\"";
- buf += type;
- buf += "\">";
+ outText("<div class=\"", buf, u);
+ outText(type, buf, u);
+ outText("\">", buf, u);
}
else if (tag.isEndTag()) {
- buf += "</div>";
+ outText("</div>", buf, u);
}
- else buf += tag;
+ else if (!(type == "colophon")) outText(tag, buf, u);
}
else if (!strcmp(tag.getName(), "span")) {
- buf += tag;
+ outText(tag, buf, u);
}
else if (!strcmp(tag.getName(), "abbr")) {
if (!tag.isEndTag()) {
SWBuf title = tag.getAttribute("expansion");
- buf += "<abbr title=\"";
- buf += title;
- buf += "\">";
+ outText("<abbr title=\"", buf, u);
+ outText(title, buf, u);
+ outText("\">", buf, u);
}
else if (tag.isEndTag()) {
- buf += "</abbr>";
+ outText("</abbr>", buf, u);
}
}
else if (!strcmp(tag.getName(), "br")) {
- buf += tag;
+ outText( tag, buf, u);
}
else if (!strcmp(tag.getName(), "table")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "<table><tbody>\n";
+ outText( "<table><tbody>\n", buf, u);
}
else if (tag.isEndTag()) {
- buf += "</tbody></table>\n";
+ outText( "</tbody></table>\n", buf, u);
++u->consecutiveNewlines;
u->supressAdjacentWhitespace = true;
}
@@ -803,19 +813,19 @@
}
else if (!strcmp(tag.getName(), "row")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "\t<tr>";
+ outText( "\t<tr>", buf, u);
}
else if (tag.isEndTag()) {
- buf += "</tr>\n";
+ outText( "</tr>\n", buf, u);
}
}
else if (!strcmp(tag.getName(), "cell")) {
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- buf += "<td>";
+ outText( "<td>", buf, u);
}
else if (tag.isEndTag()) {
- buf += "</td>";
+ outText( "</td>", buf, u);
}
}
else {
More information about the sword-cvs
mailing list