fix: error in find_macros when the input is empty

Added a special case to handle this issue.
This commit is contained in:
Anand Chitipothu
2021-06-22 18:12:31 +05:30
parent fc1c393f15
commit f303be4db5

View File

@@ -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]