85 setEscapeStringCaseSensitive(
true);
87 addEscapeStringSubstitute(
"amp",
"&");
88 addEscapeStringSubstitute(
"apos",
"'");
89 addEscapeStringSubstitute(
"lt",
"<");
90 addEscapeStringSubstitute(
"gt",
">");
91 addEscapeStringSubstitute(
"quot",
"\"");
95 setTokenCaseSensitive(
true);
100 return new MyUserData(module, key);
110 for (text =
""; *from; from++) {
128 for (text =
""; *from; from++) {
129 if ((strchr(
" \t\n\r", *from))) {
130 while (*(from+1) && (strchr(
" \t\n\r", *(from+1)))) {
146 MyUserData *u = (MyUserData *)userData;
148 bool sub = (u->suspendTextPassThru) ? substituteToken(scratch, token) : substituteToken(buf, token);
153 if (!strcmp(tag.
getName(),
"w")) {
169 lastText = u->lastTextNode.c_str();
171 else lastText =
"stuff";
176 val = strchr(attrib,
':');
177 val = (val) ? (val + 1) : attrib;
182 val = strchr(attrib,
':');
183 val = (val) ? (val + 1) : attrib;
189 int i = (count > 1) ? 0 : -1;
193 val = strchr(attrib,
':');
194 val = (val) ? (val + 1) : attrib;
195 const char *val2 = val;
196 if ((strchr(
"GH", *val)) && (isdigit(val[1])))
198 if ((!strcmp(val2,
"3588")) && (lastText.
length() < 1))
204 }
while (++i < count);
208 if ((strstr(savelemma.
c_str(),
"3588")) && (lastText.
length() < 1))
212 int i = (count > 1) ? 0 : -1;
216 val = strchr(attrib,
':');
217 val = (val) ? (val + 1) : attrib;
218 const char *val2 = val;
219 if ((*val ==
'T') && (strchr(
"GH", val[1])) && (isdigit(val[2])))
223 }
while (++i < count);
227 val = strchr(attrib,
':');
228 val = (val) ? (val + 1) : attrib;
239 else if (!strcmp(tag.
getName(),
"note")) {
244 if ((type !=
"x-strongsMarkup")
245 && (type !=
"strongsMarkup")
249 char ch = ((!strcmp(type.
c_str(),
"crossReference")) || (!strcmp(type.
c_str(),
"x-cross-ref"))) ?
'x':
'n';
250 scratch.
setFormatted(
"{\\super <a href=\"\">*%c%i.%s</a>} ", ch, u->vkey->getVerse(), footnoteNumber.
c_str());
252 u->inXRefNote = (ch ==
'x');
255 u->suspendTextPassThru = (++u->suspendLevel);
259 u->suspendTextPassThru = (--u->suspendLevel);
260 u->inXRefNote =
false;
265 else if (!strcmp(tag.
getName(),
"p") || !strcmp(tag.
getName(),
"lg")) {
267 outText(
"{\\fi200\\par}", buf, u);
274 outText(
"{\\pard\\par}", buf, u);
285 outText(
"{\\fi200\\par}", buf, u);
295 else if (!strcmp(tag.
getName(),
"reference")) {
296 if (!u->inXRefNote) {
298 outText(
"{<a href=\"\">", buf, u);
307 else if (!strcmp(tag.
getName(),
"l")) {
330 else if (!strcmp(tag.
getName(),
"title")) {
332 outText(
"{\\par\\i1\\b1 ", buf, u);
339 else if (!strcmp(tag.
getName(),
"list")) {
341 outText(
"\\par\\pard", buf, u);
344 outText(
"\\par\\pard", buf, u);
349 else if (!strcmp(tag.
getName(),
"item")) {
359 else if (!strcmp(tag.
getName(),
"rdg") || !strcmp(tag.
getName(),
"catchWord")) {
369 else if (!strcmp(tag.
getName(),
"hi")) {
372 if (type ==
"bold" || type ==
"b" || type ==
"x-b")
390 else if (!strcmp(tag.
getName(),
"q")) {
394 int level = (tmp) ? atoi(tmp) : 1;
405 u->quoteStack.push(tagData);
416 else if (u->osisQToTick)
417 outText((level % 2) ?
'\"' :
'\'', buf, u);
422 if (tag.
isEndTag() && !u->quoteStack.empty()) {
423 char *tagData = u->quoteStack.top();
431 level = (tmp) ? atoi(tmp) : 1;
441 else if (u->osisQToTick)
442 outText((level % 2) ?
'\"' :
'\'', buf, u);
457 int level = (tmp) ? atoi(tmp) : 1;
463 else if (u->osisQToTick)
464 outText((level % 2) ?
'\"' :
'\'', buf, u);
468 else if (!strcmp(tag.
getName(),
"transChange")) {
483 else if (!strcmp(tag.
getName(),
"divineName")) {
494 else if (!strcmp(tag.
getName(),
"div")) {
505 else if (!strcmp(tag.
getName(),
"figure")) {
510 char* filepath =
new char[strlen(u->module->getConfigEntry(
"AbsoluteDataPath")) + strlen(token)];
513 strcat(filepath, src);
516 outText(
"<img src=\"", buf, u);
const char * getName() const
#define SWORD_NAMESPACE_START
unsigned long length() const
virtual char processText(SWBuf &text, const SWKey *key=0, const SWModule *module=0)
const char * getType() const
virtual const char * getConfigEntry(const char *key) const
const char * getName() const
const char * toString() const
SWORD_NAMESPACE_START char * stdstr(char **ipstr, const char *istr, unsigned int memPadFactor=1)
const char * c_str() const
virtual char processText(SWBuf &text, const SWKey *key=0, const SWModule *module=0)
static void outText(const char *t, SWBuf &o, BasicFilterUserData *u)
const char * getAttribute(const char *attribName, int partNum=-1, char partSplit= '|') const
bool supressAdjacentWhitespace
bool isEndTag(const char *eID=0) const
#define SWORD_NAMESPACE_END
SWBuf & setFormatted(const char *format,...)
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData)
std::stack< char * > quoteStack
int getAttributePartCount(const char *attribName, char partSplit= '|') const
virtual BasicFilterUserData * createUserData(const SWModule *module, const SWKey *key)