diff options
Diffstat (limited to 'api/Utilities.cpp')
| -rw-r--r-- | api/Utilities.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/api/Utilities.cpp b/api/Utilities.cpp index b372b13a..6464ae17 100644 --- a/api/Utilities.cpp +++ b/api/Utilities.cpp @@ -39,7 +39,7 @@ const char LEGAL_NOTICE[] = " */\n\n"; const char AUTO_GENERATED_WARNING[] = - "Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime."; + "Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh."; string capitalize(const string& source) { int length = source.length(); @@ -95,28 +95,29 @@ bool charRemoved(char c, string* s) { } string stripHtml(const string& html) { - string s; - for (size_t start = 0; start < html.size(); start++) { - size_t lt = html.find('<', start); + string in = stringReplace(html, "<li>", "- "); + string out; + for (size_t start = 0; start < in.size(); start++) { + size_t lt = in.find('<', start); if (lt == string::npos) { - s += html.substr(start); + out += in.substr(start); break; } - s += html.substr(start, lt - start); - if (isalpha(html[lt + 1]) || html[lt + 1] == '/') { + out += in.substr(start, lt - start); + if (isalpha(in[lt + 1]) || in[lt + 1] == '/') { // It's an HTML tag. Search for the end. - start = html.find('>', lt + 1); + start = in.find('>', lt + 1); if (start == string::npos) { break; } } else { - s += '<'; + out += '<'; } } - s = stringReplace(s, ">", ">"); - s = stringReplace(s, "<", "<"); - s = stringReplace(s, " ", " "); - return s; + out = stringReplace(out, ">", ">"); + out = stringReplace(out, "<", "<"); + out = stringReplace(out, " ", " "); + return out; } string hashString(const string& s) { |
