[sword-svn] r3191 - trunk/src/modules/filters
scribe at crosswire.org
scribe at crosswire.org
Sat Apr 19 10:06:38 MST 2014
Author: scribe
Date: 2014-04-19 10:06:38 -0700 (Sat, 19 Apr 2014)
New Revision: 3191
Modified:
trunk/src/modules/filters/thmlheadings.cpp
Log:
added preverse backward compat for thml
Modified: trunk/src/modules/filters/thmlheadings.cpp
===================================================================
--- trunk/src/modules/filters/thmlheadings.cpp 2014-04-19 16:21:24 UTC (rev 3190)
+++ trunk/src/modules/filters/thmlheadings.cpp 2014-04-19 17:06:38 UTC (rev 3191)
@@ -86,13 +86,22 @@
tag = token;
if (hide && tag.isEndTag()) {
if (module->isProcessEntryAttributes() && (option || (!preverse))) {
+ SWBuf heading;
+ SWBuf cls = startTag.getAttribute("class");
+ if (!cls.startsWith("fromEntryAttributes")) {
+ cls = SWBuf("fromEntryAttributes ") + cls;
+ startTag.setAttribute("class", cls);
+ }
+ heading += startTag;
+ heading += header;
+ heading += tag;
if (preverse) {
sprintf(buf, "%i", pvHeaderNum++);
- module->getEntryAttributes()["Heading"]["Preverse"][buf] = header;
+ module->getEntryAttributes()["Heading"]["Preverse"][buf] = heading;
}
else {
sprintf(buf, "%i", headerNum++);
- module->getEntryAttributes()["Heading"]["Interverse"][buf] = header;
+ module->getEntryAttributes()["Heading"]["Interverse"][buf] = heading;
if (option) { // we want the tag in the text
text.append(header);
}
@@ -143,8 +152,17 @@
}
*/
}
- else
+ else {
isheader = false;
+ SWBuf cls = tag.getAttribute("class");
+ if (cls.startsWith("fromEntryAttributes ")) {
+ cls << SWBuf("fromEntryAttributes ").size();
+ tag.setAttribute("class", cls);
+ token = tag;
+ token << 1;
+ token.setSize(token.size() - 1);
+ }
+ }
}
if (withinDiv && isheader) {
More information about the sword-cvs
mailing list