diff --git a/tools/article_utils.py b/tools/article_utils.py index f00b20a..f2c730b 100644 --- a/tools/article_utils.py +++ b/tools/article_utils.py @@ -2,7 +2,7 @@ import time, subprocess def the_line_after_metadata(lines: []) -> int: i = 0 - while lines[i].strip(): + while i < len(lines) and lines[i].strip(): i += 1 return i @@ -19,7 +19,7 @@ def parse_metadata(filepath: str) -> {}: result["Date"] = time.gmtime(int(val)) elif key == "Tags": result["Tags"] = [v.strip() for v in val.split(",")] - else: + elif val: result[key] = val result["Last Edit"] = time.gmtime(int(subprocess.getoutput(r"stat -c %Y " + filepath)))