mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
i18n - unit tests
- Added more utf8.t unit tests. - Removed text.cpp:extractParagraphs, which is not used.
This commit is contained in:
parent
3d3d788961
commit
165001acac
3 changed files with 2 additions and 24 deletions
22
src/text.cpp
22
src/text.cpp
|
@ -104,28 +104,6 @@ void join (
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void extractParagraphs (const std::string& input, std::vector<std::string>& output)
|
||||
{
|
||||
std::string copy = input;
|
||||
while (1)
|
||||
{
|
||||
size_t so = copy.find ("<p>");
|
||||
size_t eo = copy.find ("</p>");
|
||||
|
||||
if (so == std::string::npos && eo == std::string::npos)
|
||||
break;
|
||||
|
||||
std::string extract = trim (copy.substr (so + 3, eo - so - 3));
|
||||
copy = copy.substr (eo + 4, std::string::npos);
|
||||
output.push_back (extract);
|
||||
}
|
||||
|
||||
// There were no paragraphs.
|
||||
if (!output.size ())
|
||||
output.push_back (input);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string trimLeft (const std::string& in, const std::string& t /*= " "*/)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue