diff options
| -rwxr-xr-x | news | bin | 702152 -> 702152 bytes | |||
| -rw-r--r-- | src/RSS.hpp | 10 |
2 files changed, 7 insertions, 3 deletions
| Binary files differ diff --git a/src/RSS.hpp b/src/RSS.hpp index 5dd8376..c4a5b2c 100644 --- a/src/RSS.hpp +++ b/src/RSS.hpp @@ -95,7 +95,7 @@ class XML_leaf { std::string GetValue() { if (isCDATA(Value)) - return getCDATA(Value); + return getCDATA(Value, true); return Value; } @@ -146,11 +146,15 @@ class XML_leaf { } // Assumes the string is CDATA - static std::string getCDATA(std::string token) { + static std::string getCDATA(std::string token, bool toRawString = false) { // 9 = "<!CDATA[".length // 3 = "]]>".length if (token.length() < 9 + 3) return token; - return token.substr(9, token.length() - (9+3)); + auto data = token.substr(9, token.length() - (9+3)); + if (toRawString) { + data = std::regex_replace(data, std::regex("<[a-zA-Z/]+>"), ""); + } + return data; } static bool isClosingTagOf(std::string token, std::string opening_tag){ |
