37 const static char *header =
"\
38 .divineName { font-variant: small-caps; }\n\
39 .wordsOfJesus { color: red; }\n\
40 .transChange { font-style: italic; }\n\
41 .transChange.transChange-supplied { font-style: italic; }\n\
42 .transChange.transChange-added { font-style: italic; }\n\
43 .transChange.transChange-tenseChange::before { content: '*'; }\n\
44 .transChange.transChange-tenseChange { font-style: normal; }\n\
45 .transChange:lang(zh) { font-style: normal; text-decoration: dotted underline; }\n\
46 .overline { text-decoration: overline; }\n\
47 .indent1 { margin-left: 1em; }\n\
48 .indent2 { margin-left: 2em; }\n\
49 .indent3 { margin-left: 3em; }\n\
50 .indent4 { margin-left: 4em; }\n\
51 abbr { &:hover{ &:before{ content: attr(title); } } }\n\
52 .small-caps { font-variant: small-caps; }\n\
53 .otPassage { font-variant: small-caps; }\n\
54 .selah { text-align: right; width: 50%; margin: 0; padding: 0; }\n\
55 .acrostic { text-align: center; }\n\
56 .colophon {font-style: italic; font-size: small; display: block; }\n\
57 .rdg { font-style: italic; }\n\
58 .inscription {font-variant: small-caps; }\n\
59 .catchWord {font-style: bold; }\n\
60 .x-p-indent {text-indent: 1em; }\n\
79 int i = (count > 1) ? 0 : -1;
85 val = strchr(attrib,
':');
86 val = (val) ? (val + 1) : attrib;
91 else if (*val ==
'H') {
94 else if (prefix) gh = prefix;
95 const char *val2 = val;
96 if ((strchr(
"GH", *val)) && (isdigit(val[1])))
101 if (!suspendTextPassThru) {
102 buf.
appendFormatted(
"<small><em class=\"strongs\"><<a class=\"strongs\" href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\" class=\"strongs\">%s</a>></em></small>",
109 }
while (++i < count);
124 int i = (count > 1) ? 0 : -1;
128 val = strchr(attrib,
':');
129 val = (val) ? (val + 1) : attrib;
130 const char *val2 = val;
131 if ((*val ==
'T') && (strchr(
"GH", val[1])) && (isdigit(val[2])))
133 if (!suspendTextPassThru) {
134 buf.
appendFormatted(
"<small><em class=\"morph\">(<a class=\"morph\" href=\"passagestudy.jsp?action=showMorph&type=%s&value=%s\" class=\"morph\">%s</a>)</em></small>",
139 }
while (++i < count);
206 if (++consecutiveNewlines <= 2) {
213 outText(
"<br />\n", buf,
this);
215 supressAdjacentWhitespace =
true;
227 if (!strcmp(tag.
getName(),
"w")) {
244 else lastText =
"stuff";
249 val = strchr(attrib,
':');
250 val = (val) ? (val + 1) : attrib;
261 outText(
"</rb><rp>(</rp><rt>", buf, u);
262 val = strchr(attrib,
':');
263 val = (val) ? (val + 1) : attrib;
265 outText(
"</rt><rp>)</rp></ruby>", buf, u);
276 val = strchr(attrib,
':');
277 val = (val) ? (val + 1) : attrib;
288 else if (!strcmp(tag.
getName(),
"note")) {
293 if (type ==
"strongsMarkup") type =
"x-strongsMarkup";
294 if (type ==
"x-cross-ref") type =
"crossReference";
297 SWBuf classExtras =
"";
302 if (subType.
size()) {
306 bool strongsMarkup = type ==
"x-strongsMarkup";
313 if (!strongsMarkup) {
316 char ch = (type ==
"crossReference" ?
'x':
'n');
323 buf.
appendFormatted(
"<a class=\"noteMarker%s\" href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
334 buf.
appendFormatted(
"<a class=\"noteMarker%s\" href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
356 else if (!strcmp(tag.
getName(),
"p") || !strcmp(tag.
getName(),
"lg")) {
377 outText(
"<div class=\"colophon\">", buf, u);
393 else if (!strcmp(tag.
getName(),
"reference")) {
402 bool is_scripRef =
false;
405 const char* the_ref = strchr(target,
':');
426 if(!strncmp(work,
"Bible", 5))
432 buf.
appendFormatted(
"<a class=\"%s\" href=\"passagestudy.jsp?action=showRef&type=scripRef&value=%s&module=\">",
455 else if (!strcmp(tag.
getName(),
"l")) {
459 if (type ==
"selah") {
460 outText(
"<p class=\"selah\">", buf, u);
472 type = startTag.getAttribute(
"type");
474 if (type ==
"selah") {
499 if (!strcmp(type,
"line")) {
505 else if (!strcmp(type,
"x-p")) {
510 else if (!strcmp(type,
"cQuote")) {
515 int level = (tmp) ? atoi(tmp) : 1;
522 outText((level % 2) ?
'\"' :
'\'', buf, u);
524 else if (!strcmp(type,
"x-importer")) {
531 outText(
SWBuf(
"<span class=\"") + attVal +
"\"", buf,u);
533 for (StringList::const_iterator it = attributes.begin(); it != attributes.end(); ++it) {
535 outText(
SWBuf(
" data-") + *it +
"=\"" + attVal +
"\"", buf,u);
543 else if (!strcmp(tag.
getName(),
"title")) {
548 SWBuf classExtras =
"";
553 if (canonical.
size() && !strcmp(canonical,
"true")) {
554 classExtras.
append(
" canonical");
560 outText(
SWBuf(
"<h1 class=\"moduleHeader") + classExtras +
"\">", buf, u);
564 outText(
SWBuf(
"<h1 class=\"testamentHeader") + classExtras +
"\">", buf, u);
569 outText(
SWBuf(
"<h1 class=\"bookHeader") + classExtras +
"\">", buf, u);
574 outText(
SWBuf(
"<h2 class=\"chapterHeader") + classExtras +
"\">", buf, u);
579 outText(
SWBuf(
"<h3 class=\"title") + classExtras +
"\">", buf, u);
602 else if (!strcmp(tag.
getName(),
"list")) {
614 else if (!strcmp(tag.
getName(),
"item")) {
625 else if (!strcmp(tag.
getName(),
"rdg") || !strcmp(tag.
getName(),
"catchWord") || !strcmp(tag.
getName(),
"inscription")) {
627 outText(
"<span class=\"", buf, u);
636 else if (!strcmp(tag.
getName(),
"seg")) {
639 outText(
"<span class=\"", buf, u);
649 else if (!strcmp(tag.
getName(),
"divineName")) {
656 if (lastText.
size()) {
664 else if (!strcmp(tag.
getName(),
"hi")) {
671 if (type ==
"bold" || type ==
"b" || type ==
"x-b") {
680 else if (type ==
"ol" || type ==
"overline" || type ==
"x-overline") {
681 outText(
"<span class=\"overline\">", buf, u);
684 else if (type ==
"super") {
687 else if (type ==
"sub") {
690 else if (type ==
"i" || type ==
"italic") {
706 if (type ==
"bold" || type ==
"b" || type ==
"x-b") {
709 else if (type ==
"ol") {
712 else if (type ==
"super") {
715 else if (type ==
"sub") {
718 else if (type ==
"i" || type ==
"italic") {
734 else if (!strcmp(tag.
getName(),
"q")) {
738 int level = (tmp) ? atoi(tmp) : 1;
759 outText((level % 2) ?
'\"' :
'\'', buf, u);
768 type = qTag.getAttribute(
"type");
769 who = qTag.getAttribute(
"who");
770 tmp = qTag.getAttribute(
"level");
771 level = (tmp) ? atoi(tmp) : 1;
772 tmp = qTag.getAttribute(
"marker");
782 outText((level % 2) ?
'\"' :
'\'', buf, u);
791 else if (!strcmp(tag.
getName(),
"transChange")) {
796 outText(
"<span class=\"transChange", buf, u);
798 outText(
" transChange-", buf, u);
811 else if (!strcmp(tag.
getName(),
"figure")) {
817 if ((filepath.
size()) && (filepath[filepath.
size()-1] !=
'/') && (src[0] !=
'/'))
823 outText(
"<a href=\"passagestudy.jsp?action=showImage&value=", buf, u);
829 outText(
"<img src=\"file:", buf, u);
831 outText(
"\" border=\"0\" />", buf, u);
838 else if (!strcmp(tag.
getName(),
"div")) {
840 if (type ==
"bookGroup") {
842 else if (type ==
"book") {
844 else if (type ==
"section") {
846 else if (type ==
"majorSection") {
850 outText(
"<div class=\"", buf, u);
857 else if (!(type ==
"colophon")) {
864 else if (!strcmp(tag.
getName(),
"span")) {
867 else if (!strcmp(tag.
getName(),
"abbr")) {
870 outText(
"<abbr title=\"", buf, u);
879 else if (!strcmp(tag.
getName(),
"br")) {
882 else if (!strcmp(tag.
getName(),
"table")) {
884 outText(
"<table><tbody>\n", buf, u);
887 outText(
"</tbody></table>\n", buf, u);
893 else if (!strcmp(tag.
getName(),
"row")) {
902 else if (!strcmp(tag.
getName(),
"cell")) {
const char * getName() const
SWBuf interModuleLinkStart
#define SWORD_NAMESPACE_START
SWBuf & appendFormatted(const char *format,...)
void setTokenEnd(const char *tokenEnd)
void addAllowedEscapeString(const char *findString)
unsigned long length() const
const char * getType() const
void setEmpty(bool value)
const char * setAttribute(const char *attribName, const char *attribValue, int partNum=-1, char partSplit= '|')
virtual const char * getConfigEntry(const char *key) const
const char * getName() const
bool startsWith(const SWBuf &prefix) const
MyUserData(const SWModule *module, const SWKey *key)
const char * toString() const
void setTokenCaseSensitive(bool val)
void setEscapeStart(const char *escStart)
bool substituteToken(SWBuf &buf, const char *token)
virtual const char * getText() const
virtual const char * getText() const
void processLemma(bool suspendTextPassThru, XMLTag &tag, SWBuf &buf)
const StringList getAttributeNames() const
void setTokenStart(const char *tokenStart)
virtual int getChapter() const
const char * c_str() const
std::list< SWBuf > StringList
SWBuf & append(const char *str, long max=-1)
void setEndTag(bool value)
void setPassThruNumericEscapeString(bool val)
static SWORD_NAMESPACE_START const char * classes[]
virtual char getBook() const
static void outText(const char *t, SWBuf &o, BasicFilterUserData *u)
virtual int getVerse() const
void processMorph(bool suspendTextPassThru, XMLTag &tag, SWBuf &buf)
void outputNewline(SWBuf &buf)
unsigned long size() const
const char * stripPrefix(char separator, bool endOfStringAsSeparator=false)
virtual bool isProcessEntryAttributes() const
virtual AttributeTypeList & getEntryAttributes() const
const char * getAttribute(const char *attribName, int partNum=-1, char partSplit= '|') const
bool supressAdjacentWhitespace
void setEscapeStringCaseSensitive(bool val)
bool isEndTag(const char *eID=0) const
virtual BasicFilterUserData * createUserData(const SWModule *module, const SWKey *key)
virtual const char * getHeader() const
void setEscapeEnd(const char *escEnd)
#define SWORD_NAMESPACE_END
SWBuf & setFormatted(const char *format,...)
static const SWBuf encode(const char *urlText)
void setSize(unsigned long len)
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData)
virtual char getTestament() const
int getAttributePartCount(const char *attribName, char partSplit= '|') const