[sword-svn] r2334 - trunk/src/modules/filters
scribe at crosswire.org
scribe at crosswire.org
Thu Apr 23 17:14:13 MST 2009
Author: scribe
Date: 2009-04-23 17:14:12 -0700 (Thu, 23 Apr 2009)
New Revision: 2334
Modified:
trunk/src/modules/filters/osishtmlhref.cpp
trunk/src/modules/filters/osisplain.cpp
trunk/src/modules/filters/osisrtf.cpp
trunk/src/modules/filters/osiswebif.cpp
Log:
Applied patch from DM to update handling for paragraphs
Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp 2009-04-23 11:11:25 UTC (rev 2333)
+++ trunk/src/modules/filters/osishtmlhref.cpp 2009-04-24 00:14:12 UTC (rev 2334)
@@ -287,6 +287,21 @@
}
}
+ // 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")) {
+ // <div type="paragraph" sID... />
+ if (tag.getAttribute("sID")) { // non-empty start tag
+ outText("<!P><br />", buf, u);
+ }
+ // <div type="paragraph" eID... />
+ else if (tag.getAttribute("eID")) {
+ outText("<!/P><br />", buf, u);
+ userData->supressAdjacentWhitespace = true;
+ }
+ }
+
// <reference> tag
else if (!strcmp(tag.getName(), "reference")) {
if (!u->inXRefNote) { // only show these if we're not in an xref note
Modified: trunk/src/modules/filters/osisplain.cpp
===================================================================
--- trunk/src/modules/filters/osisplain.cpp 2009-04-23 11:11:25 UTC (rev 2333)
+++ trunk/src/modules/filters/osisplain.cpp 2009-04-24 00:14:12 UTC (rev 2334)
@@ -178,6 +178,15 @@
buf.append('\n');
}
+ // Milestoned paragraph, created by osis2mod
+ // <div type="paragraph" sID... />
+ // <div type="paragraph" eID... />
+ else if (!strcmp(u->tag.getName(), "div") && u->tag.getAttribute("type") && !strcmp(u->tag.getAttribute("type"), "paragraph") &&
+ (u->tag.isEmpty() && (u->tag.getAttribute("sID") || u->tag.getAttribute("eID")))) {
+ userData->supressAdjacentWhitespace = true;
+ buf.append('\n');
+ }
+
// <lb .../>
else if (!strncmp(token, "lb", 2)) {
userData->supressAdjacentWhitespace = true;
Modified: trunk/src/modules/filters/osisrtf.cpp
===================================================================
--- trunk/src/modules/filters/osisrtf.cpp 2009-04-23 11:11:25 UTC (rev 2333)
+++ trunk/src/modules/filters/osisrtf.cpp 2009-04-24 00:14:12 UTC (rev 2334)
@@ -280,6 +280,21 @@
}
}
+ // 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")) {
+ // <div type="paragraph" sID... />
+ if (tag.getAttribute("sID")) { // non-empty start tag
+ outText("{\\fi200\\par}", buf, u);
+ }
+ // <div type="paragraph" eID... />
+ else if (tag.getAttribute("eID")) {
+ outText("{\\par}", buf, u);
+ userData->supressAdjacentWhitespace = true;
+ }
+ }
+
// <reference> tag
else if (!strcmp(tag.getName(), "reference")) {
if (!u->inXRefNote) { // only show these if we're not in an xref note
Modified: trunk/src/modules/filters/osiswebif.cpp
===================================================================
--- trunk/src/modules/filters/osiswebif.cpp 2009-04-23 11:11:25 UTC (rev 2333)
+++ trunk/src/modules/filters/osiswebif.cpp 2009-04-24 00:14:12 UTC (rev 2334)
@@ -175,6 +175,14 @@
}
}
+ // 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")) {
+ // This is properly handled by base class.
+ return OSISHTMLHREF::handleToken(buf, token, userData);
+ }
+
// ok to leave these in
else if (!strcmp(tag.getName(), "div")) {
buf += tag;
More information about the sword-cvs
mailing list