From b08e93e2455d6b1dcdfaf6883ab34e254d481a57 Mon Sep 17 00:00:00 2001 From: bbassie Date: Fri, 16 Apr 2021 22:45:58 +0200 Subject: [PATCH] Fix parse_message --- modules/gui/task-list.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/gui/task-list.lua b/modules/gui/task-list.lua index ecfb7852..d8173d36 100644 --- a/modules/gui/task-list.lua +++ b/modules/gui/task-list.lua @@ -323,17 +323,13 @@ local function parse_message(str) -- Trimm the spaces of the string local trimmed = (string.gsub(str, "^%s*(.-)%s*$", "%1")) local message = { title = "", body = "" } - -- If it doesn't match the patter return the str as a title - local match = string.match(trimmed, message_pattern) - if not match then + local title, body = string.match(trimmed, message_pattern) + if not title then + -- If it doesn't match the patter return the str as a title message.title = trimmed - return message - end - -- If message has multiple lines - for key, value in string.gmatch(trimmed, message_pattern) do - message.title = key - message.body = value - break + else + message.title = title + message.body = body end return message end