Commit 6a2f2c50 authored by Raniere Silva's avatar Raniere Silva
Browse files

Merge pull request #160 from abought/link_validation_mailto

Skip mailto links in link validation
parents 98029a72 b3b1b382
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -362,9 +362,10 @@ class MarkdownValidator(object):
            # Validate local html links have matching md file
            return self._validate_one_html_link(link_node,
                                                check_text=check_text)
        elif not re.match(r"^((https?|ftp)://.+)", dest, re.IGNORECASE)\
        elif not re.match(r"^((https?|ftp)://.+)|mailto:",
                          dest, re.IGNORECASE)\
                and not re.match(r"^#.*", dest):
            # If not web URL, and not anchor on same page, then
            # If not web or email URL, and not anchor on same page, then
            #  verify that local file exists
            dest_path = os.path.join(self.lesson_dir, dest)
            dest_path = dest_path.split("#")[0]  # Split anchor from filename