Support editing multi-line annotations (Closes: #2283)

Since e4b9c1f annotations where JSON encoded in task edit to escape
new lines (\n). But other strings where mangled as well, like https://
becoming https:\/\/, making it hard to edit.

This patch removes the JSON encoding and indents new lines instead.
This commit is contained in:
Jochen Sprickerhof 2020-12-26 23:49:27 +01:00 committed by Tomas Babej
parent 1cbcdf0969
commit a95205357c
2 changed files with 30 additions and 4 deletions

View file

@ -41,12 +41,14 @@ private:
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::string replaceString (std::string text, const std::string& search, const std::string& replacement);
std::string formatDate (Task&, const std::string&, const std::string&);
std::string formatDuration (Task&, const std::string&);
std::string formatTask (Task, const std::string&);
void parseTask (Task&, const std::string&, const std::string&);
enum class editResult { error, changes, nochanges };
editResult editFile (Task&);
static const std::string ANNOTATION_EDIT_MARKER;
};
#endif