Don't show the '#' before tags in the UI

This commit is contained in:
Vyn 2024-04-21 09:43:56 +02:00
parent e18691d72c
commit 6ca786a4f6
3 changed files with 34 additions and 16 deletions

View file

@ -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() != "") {