summaryrefslogtreecommitdiff
path: root/src/modules/filters/thmlheadings.cpp
diff options
context:
space:
mode:
authorDaniel Glassey <wdg@debian.org>2015-09-07 11:14:57 +0100
committerDaniel Glassey <wdg@debian.org>2015-09-07 11:14:57 +0100
commit7b6c8b08e9d29332dcd0a1029e7421334bfb6f61 (patch)
treedc263ee8b6c923716a8e0fed64756b7af1238dc7 /src/modules/filters/thmlheadings.cpp
parent7a00574163029c0c2b649878c95d5acbd083564a (diff)
Imported Upstream version 1.7.3+dfsg
Diffstat (limited to 'src/modules/filters/thmlheadings.cpp')
-rw-r--r--src/modules/filters/thmlheadings.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/modules/filters/thmlheadings.cpp b/src/modules/filters/thmlheadings.cpp
index 46498d0..99bd12a 100644
--- a/src/modules/filters/thmlheadings.cpp
+++ b/src/modules/filters/thmlheadings.cpp
@@ -3,7 +3,7 @@
* thmlheadings.cpp - SWFilter descendant to hide or show headings
* in a ThML module
*
- * $Id: thmlheadings.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: thmlheadings.cpp 3195 2014-04-24 03:03:26Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -86,13 +86,22 @@ char ThMLHeadings::processText(SWBuf &text, const SWKey *key, const SWModule *mo
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 @@ char ThMLHeadings::processText(SWBuf &text, const SWKey *key, const SWModule *mo
}
*/
}
- 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) {