[sword-svn] r3190 - trunk/src/modules/filters
scribe at crosswire.org
scribe at crosswire.org
Sat Apr 19 09:21:24 MST 2014
Author: scribe
Date: 2014-04-19 09:21:24 -0700 (Sat, 19 Apr 2014)
New Revision: 3190
Modified:
trunk/src/modules/filters/osisheadings.cpp
Log:
fixed preverse div/title handling to not double process title tags
Modified: trunk/src/modules/filters/osisheadings.cpp
===================================================================
--- trunk/src/modules/filters/osisheadings.cpp 2014-04-17 05:00:28 UTC (rev 3189)
+++ trunk/src/modules/filters/osisheadings.cpp 2014-04-19 16:21:24 UTC (rev 3190)
@@ -92,7 +92,6 @@
if (tag.isEndTag(u->sID)) {
if (!u->depth-- || u->sID) {
// see comment below about preverse div changed and needing to preserve the <title> container tag for old school pre-verse titles
- if (u->currentHeadingName == "title") u->heading.append(tag);
// we've just finished a heading. It's all stored up in u->heading
bool canonical = (SWBuf("true") == u->currentHeadingTag.getAttribute("canonical"));
bool preverse = (SWBuf("x-preverse") == u->currentHeadingTag.getAttribute("subType") || SWBuf("x-preverse") == u->currentHeadingTag.getAttribute("subtype"));
@@ -100,7 +99,20 @@
// do we want to put anything in EntryAttributes?
if (u->module->isProcessEntryAttributes() && (option || canonical || !preverse)) {
SWBuf buf; buf.appendFormatted("%i", u->headerNum++);
- u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = u->heading;
+ // leave the actual <title...> wrapper in if we're part of an old school preverse title
+ // because now frontend have to deal with preverse as a div which may or may not include <title> elements
+ // and they can't simply wrap all preverse material in <h1>, like they probably did previously
+ SWBuf heading;
+ if (u->currentHeadingName == "title") {
+ XMLTag wrapper = u->currentHeadingTag;
+ if (SWBuf("x-preverse") == wrapper.getAttribute("subType")) wrapper.setAttribute("subType", 0);
+ else if (SWBuf("x-preverse") == wrapper.getAttribute("subtype")) wrapper.setAttribute("subtype", 0);
+ heading = wrapper;
+ heading += u->heading;
+ heading += tag;
+ }
+ else heading = u->heading;
+ u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = heading;
StringList attributes = u->currentHeadingTag.getAttributeNames();
for (StringList::const_iterator it = attributes.begin(); it != attributes.end(); it++) {
@@ -132,16 +144,7 @@
u->currentHeadingName = name;
u->currentHeadingTag = tag;
- // leave the actual <title...> wrapper in if we're part of an old school preverse title
- // because now frontend have to deal with preverse as a div which may or may not include <title> elements
- // and they can't simply wrap all preverse material in <h1>, like they probably did previously
- if (name == "title") {
- XMLTag wrapper = tag;
- if (SWBuf("x-preverse") == wrapper.getAttribute("subType")) wrapper.setAttribute("subType", 0);
- else if (SWBuf("x-preverse") == wrapper.getAttribute("subtype")) wrapper.setAttribute("subtype", 0);
- u->heading = wrapper;
- }
- else u->heading = "";
+ u->heading = "";
u->sID = u->currentHeadingTag.getAttribute("sID");
u->depth = 0;
u->suspendTextPassThru = true;
More information about the sword-cvs
mailing list