From a433c88166e72cd886a2121933a89527927f4ea3 Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Fri, 4 Sep 2020 16:32:03 +0800 Subject: [PATCH] fix index out of range error --- scripts/check-tags.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/check-tags.py b/scripts/check-tags.py index 6da81f6827d6..1cc1fe79b28c 100644 --- a/scripts/check-tags.py +++ b/scripts/check-tags.py @@ -79,8 +79,11 @@ def filter_frontmatter(content): meta_pos = i.span()[1] collect.append(meta_pos) - filter_point = collect[1] - content = content[filter_point:] + # if the number of "---" >= 2 + if len(collect) >= 2: + filter_point = collect[1] + content = content[filter_point:] + return content def filter_backticks(content, filename):