diff options
Diffstat (limited to 'src/modules/filters/osisxhtml.cpp')
-rw-r--r-- | src/modules/filters/osisxhtml.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/modules/filters/osisxhtml.cpp b/src/modules/filters/osisxhtml.cpp index b1040a9..3f75c4a 100644 --- a/src/modules/filters/osisxhtml.cpp +++ b/src/modules/filters/osisxhtml.cpp @@ -2,9 +2,9 @@ * * osisxhtml.cpp - Render filter for classed XHTML of an OSIS module * - * $Id: osisxhtml.cpp 3005 2014-01-09 04:06:11Z greg.hellings $ + * $Id: osisxhtml.cpp 3205 2014-05-01 02:31:28Z greg.hellings $ * - * Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 2011-2014 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -38,9 +38,7 @@ const char *OSISXHTML::getHeader() const { .divineName { font-variant: small-caps; }\n\ .wordsOfJesus { color: red; }\n\ .transChangeSupplied { font-style: italic; }\n\ - .small, .sub, .sup { font-size: .83em }\n\ - .sub { vertical-align: sub }\n\ - .sup { vertical-align: super }\n\ + .overline { text-decoration: overline; }\n\ .indent1 { margin-left: 10px }\n\ .indent2 { margin-left: 20px }\n\ .indent3 { margin-left: 30px }\n\ @@ -291,7 +289,7 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData * URL::encode(vkey->getText()).c_str(), ch, ch, - (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : "")); + (renderNoteNumbers ? noteName.c_str() : "")); } else { buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>", @@ -301,7 +299,7 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData * URL::encode(u->key->getText()).c_str(), ch, ch, - (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : "")); + (renderNoteNumbers ? noteName.c_str() : "")); } } } @@ -330,7 +328,7 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData * // Milestoned paragraphs, created by osis2mod // <div type="paragraph" sID.../> // <div type="paragraph" eID.../> - else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "paragraph")) { + else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && (!strcmp(tag.getAttribute("type"), "x-p") || !strcmp(tag.getAttribute("type"), "paragraph"))) { // <div type="paragraph" sID... /> if (tag.getAttribute("sID")) { // non-empty start tag u->outputNewline(buf); @@ -563,15 +561,15 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData * // but we have used "ol" in the past, as well. Once a valid // OSIS overline attribute is made available, these should all // eventually be deprecated and never documented that they are supported. - else if (type == "ol" || type == "overline" || type == "x-overline") { - outText("<span style=\"text-decoration:overline\">", buf, u); + else if (type == "ol" || type == "overline" || type == "x-overline") { + outText("<span class=\"overline\">", buf, u); } else if (type == "super") { - outText("<span class=\"sup\">", buf, u); + outText("<sup>", buf, u); } else if (type == "sub") { - outText("<span class=\"sub\">", buf, u); + outText("<sub>", buf, u); } else { // all other types outText("<i>", buf, u); @@ -589,12 +587,18 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData * if (type == "bold" || type == "b" || type == "x-b") { outText("</b>", buf, u); } - else if ( type == "ol" - || type == "super" - || type == "sub") { + else if (type == "ol") { outText("</span>", buf, u); } - else outText("</i>", buf, u); + else if (type == "sup") { + outText("</sup>", buf, u); + } + else if (type == "sub") { + outText("</sub>", buf, u); + } + else { + outText("</i>", buf, u); + } } } |