mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Don't show the '#' before tags in the UI
This commit is contained in:
parent
e18691d72c
commit
6ca786a4f6
3 changed files with 34 additions and 16 deletions
|
@ -53,12 +53,12 @@ Tags TodoMdFormat::extractTagsFromMetadata(std::string metadata)
|
|||
{
|
||||
Tags tags;
|
||||
|
||||
std::regex regex("(#[a-zA-Z0-1]+)");
|
||||
std::regex regex("(#([a-zA-Z0-1]+))");
|
||||
std::smatch matches;
|
||||
|
||||
while (std::regex_search(metadata, matches, regex)) {
|
||||
if (!vectorUtils::contains(tags, matches[0].str())) {
|
||||
tags.push_back(matches[0]);
|
||||
if (!vectorUtils::contains(tags, matches[2].str())) {
|
||||
tags.push_back(matches[2]);
|
||||
}
|
||||
metadata = matches.suffix();
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ std::string TodoMdFormat::TaskToString(const TaskItem &task)
|
|||
if (task.getTags().size() > 0) {
|
||||
str += " --";
|
||||
for (const std::string &tag : task.getTags()) {
|
||||
str += " " + tag;
|
||||
str += " #" + tag;
|
||||
}
|
||||
}
|
||||
if (task.getStartTime() != "" && task.getEndTime() != "") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue