From cce9c649b7513a3deba694096547af42c72b7f38 Mon Sep 17 00:00:00 2001 From: Raniere Silva Date: Sat, 9 May 2015 23:39:29 -0300 Subject: [PATCH] Avoid wrong error with links at index.md We don't validate links to glossary but we validate links from index.md to ensure that their text and the title of the lesson it point to are the same. This exclude links point to one address with '#' since it probably points to a glossary entry. --- tools/check.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/check.py b/tools/check.py index 1c1fc59..fdb7533 100755 --- a/tools/check.py +++ b/tools/check.py @@ -475,8 +475,18 @@ class IndexPageValidator(MarkdownValidator): def _partition_links(self): """Check the text of every link in index.md""" - check_text = self.ast.find_external_links() - return check_text, [] + external_links = self.ast.find_external_links() + + check_text = [] + no_check_text = [] + + for link in external_links: + if '#' in link.destination: + no_check_text.append(link) + else: + check_text.append(link) + + return check_text, no_check_text def _validate_intro_section(self): """Validate the intro section -- GitLab