mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-288
- TW-288 `task edit` mangles descriptions with embedded newlines (thanks to Kevin Ballard).
This commit is contained in:
parent
68ceea953a
commit
0c1fa8b20e
4 changed files with 26 additions and 2 deletions
1
AUTHORS
1
AUTHORS
|
@ -220,3 +220,4 @@ suggestions:
|
||||||
Will Dietz
|
Will Dietz
|
||||||
Charles Ulrich
|
Charles Ulrich
|
||||||
Jack
|
Jack
|
||||||
|
Kevin Ballard
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
- TW-279 ".monthly" unexpectedly appended to task annotation (thanks to Florian
|
- TW-279 ".monthly" unexpectedly appended to task annotation (thanks to Florian
|
||||||
Hollerweger).
|
Hollerweger).
|
||||||
- TW-285 DUETODAY doesn't give any output (thanks to Jostein Berntsen).
|
- TW-285 DUETODAY doesn't give any output (thanks to Jostein Berntsen).
|
||||||
|
- TW-288 `task edit` mangles descriptions with embedded newlines (thanks to
|
||||||
|
Kevin Ballard).
|
||||||
- TW-294 Display UUID of task created by add (thanks to John West).
|
- TW-294 Display UUID of task created by add (thanks to John West).
|
||||||
- TW-306 Wrong date format in burndown view (thanks to Michele Santullo).
|
- TW-306 Wrong date format in burndown view (thanks to Michele Santullo).
|
||||||
- TW-752 task ID no longer defaults to info (thanks to Christopher Roberts).
|
- TW-752 task ID no longer defaults to info (thanks to Christopher Roberts).
|
||||||
|
|
|
@ -97,6 +97,26 @@ std::string CmdEdit::findValue (
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::string CmdEdit::findMultilineValue (
|
||||||
|
const std::string& text,
|
||||||
|
const std::string& startMarker,
|
||||||
|
const std::string& endMarker)
|
||||||
|
{
|
||||||
|
std::string::size_type start = text.find (startMarker);
|
||||||
|
if (start != std::string::npos)
|
||||||
|
{
|
||||||
|
std::string::size_type end = text.find (endMarker, start);
|
||||||
|
if (end != std::string::npos)
|
||||||
|
{
|
||||||
|
std::string value = text.substr (start + startMarker.length (),
|
||||||
|
end - (start + startMarker.length ()));
|
||||||
|
return trim (value, "\t ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::vector <std::string> CmdEdit::findValues (
|
std::vector <std::string> CmdEdit::findValues (
|
||||||
const std::string& text,
|
const std::string& text,
|
||||||
|
@ -351,7 +371,7 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
|
||||||
task.addTags (tags);
|
task.addTags (tags);
|
||||||
|
|
||||||
// description.
|
// description.
|
||||||
value = findValue (after, "\n Description:");
|
value = findMultilineValue (after, "\n Description:", "\n Created:");
|
||||||
if (task.get ("description") != value)
|
if (task.get ("description") != value)
|
||||||
{
|
{
|
||||||
if (value != "")
|
if (value != "")
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string findValue (const std::string&, const std::string&);
|
std::string findValue (const std::string&, const std::string&);
|
||||||
|
std::string findMultilineValue (const std::string&, const std::string&, const std::string&);
|
||||||
std::vector <std::string> findValues (const std::string&, const std::string&);
|
std::vector <std::string> findValues (const std::string&, const std::string&);
|
||||||
std::string formatDate (Task&, const std::string&, const std::string&);
|
std::string formatDate (Task&, const std::string&, const std::string&);
|
||||||
std::string formatDuration (Task&, const std::string&);
|
std::string formatDuration (Task&, const std::string&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue