diff options
author | Tim Dickson <dickson.tim@googlemail.com> | 2020-05-09 08:19:45 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-05-10 08:36:55 +0700 |
commit | 4cf823acaba629edb4b6e214e2b1e9069bf3f269 (patch) | |
tree | ff6bc8c6396b83ca019e4fd441c8b9f462dcbf0f /academic/sword/sword.diff | |
parent | f3ceff2451301ca448271f6efe82f6eafd87fde1 (diff) | |
download | slackbuilds-4cf823acaba629edb4b6e214e2b1e9069bf3f269.tar.gz slackbuilds-4cf823acaba629edb4b6e214e2b1e9069bf3f269.tar.xz |
academic/sword: Add patch to fix formatting.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to '')
-rw-r--r-- | academic/sword/sword.diff | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/academic/sword/sword.diff b/academic/sword/sword.diff new file mode 100644 index 0000000000..ac57df456c --- /dev/null +++ b/academic/sword/sword.diff @@ -0,0 +1,75 @@ +Index: src/mgr/stringmgr.cpp +=================================================================== +--- src/mgr/stringmgr.cpp (revision 3718) ++++ src/mgr/stringmgr.cpp (revision 3721) +@@ -20,6 +20,7 @@ + * + */ + ++#include <ctype.h> + #include <stringmgr.h> + #include <swlog.h> + #include <localemgr.h> +Index: src/modules/filters/osisxhtml.cpp +=================================================================== +--- src/modules/filters/osisxhtml.cpp (revision 3718) ++++ src/modules/filters/osisxhtml.cpp (revision 3721) +@@ -849,7 +849,11 @@ + else if (tag.isEndTag()) { + outText("</div>", buf, u); + } +- else if (!(type == "colophon")) outText(tag, buf, u); ++ else if (!(type == "colophon")) { ++ if (tag.getAttribute("sID")) tag.setEmpty(false); ++ if (tag.getAttribute("eID")) tag.setEndTag(true); ++ outText(tag, buf, u); ++ } + + } + else if (!strcmp(tag.getName(), "span")) { +Index: src/utilfuns/utilxml.cpp +=================================================================== +--- src/utilfuns/utilxml.cpp (revision 3718) ++++ src/utilfuns/utilxml.cpp (revision 3721) +@@ -291,13 +291,16 @@ + tag.append('/'); + + tag.append(getName()); +- for (StringPairMap::iterator it = attributes.begin(); it != attributes.end(); it++) { +- //tag.appendFormatted(" %s=\"%s\"", it->first.c_str(), it->second.c_str()); +- tag.append(' '); +- tag.append(it->first.c_str()); +- tag.append((strchr(it->second.c_str(), '\"')) ? "=\'" : "=\""); +- tag.append(it->second.c_str()); +- tag.append((strchr(it->second.c_str(), '\"'))? '\'' : '\"'); ++ ++ if (!isEndTag()) { ++ for (StringPairMap::iterator it = attributes.begin(); it != attributes.end(); it++) { ++ //tag.appendFormatted(" %s=\"%s\"", it->first.c_str(), it->second.c_str()); ++ tag.append(' '); ++ tag.append(it->first.c_str()); ++ tag.append((strchr(it->second.c_str(), '\"')) ? "=\'" : "=\""); ++ tag.append(it->second.c_str()); ++ tag.append((strchr(it->second.c_str(), '\"'))? '\'' : '\"'); ++ } + } + + if (isEmpty()) +Index: include/utilxml.h +=================================================================== +--- include/utilxml.h (revision 3718) ++++ include/utilxml.h (revision 3721) +@@ -75,6 +75,13 @@ + * otherwise, we return if we're a simple XML end </tag>. + */ + bool isEndTag(const char *eID = 0) const; ++ inline void setEndTag(bool value) { ++ if (!parsed) ++ parse(); ++ endTag = value; ++ if (value) ++ empty = false; ++ } + + const StringList getAttributeNames() const; + int getAttributePartCount(const char *attribName, char partSplit = '|') const; |