From f303be4db5ff69c4975ae38ab6655ccf525eb103 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Tue, 22 Jun 2021 18:12:31 +0530 Subject: [PATCH] fix: error in find_macros when the input is empty Added a special case to handle this issue. --- community/lms/md.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/community/lms/md.py b/community/lms/md.py index b256eb72..0658ca82 100644 --- a/community/lms/md.py +++ b/community/lms/md.py @@ -36,6 +36,8 @@ def find_macros(text): ('Exercise', 'four-circles') ] """ + if not text: + return [] macros = re.findall(MACRO_RE, text) # remove the quotes around the argument return [(name, _remove_quotes(arg)) for name, arg in macros]