Skip to content

Commit

Permalink
match fragments in lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Jun 26, 2024
1 parent a29ff3e commit 89e9e58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions md_dead_link_check/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

RE_HEADER = r"^(?:\s*[-+*]\s+|)[#]{1,6}\s*(.*)"
RE_LINK = r"([!]{0,1})\[([^\]!]*)\]\(([^()\s]+(?:\([^()\s]*\))*)\s*(.*?)\)"
RE_HTML_A_TAG_ID = r"<\w+\s+(?:[^>]*?\s+)?id=([\"'])(.*?)\1"
RE_HTML_A_TAG_ID = r"<\w+\s+(?:[^>]*?\s+)?(?:id|name)=([\"'])(.*?)\1"
RE_HTML_A_TAG_HREF = r"<\w+\s+(?:[^>]*?\s+)?href=([\"'])(.*?)\1"
RE_SUB = r"[$`][^`]+?[$`]"

Expand Down Expand Up @@ -123,7 +123,7 @@ def process_md_file(path: Path, root_dir: Path) -> MarkdownInfo:
# Detect id under a tag <a id="introduction"></a>
matches = re.findall(RE_HTML_A_TAG_ID, line)
for _, id in matches:
fragments.append(id)
fragments.append(id.lower())

# Detect links under a tag <a href="introduction"></a>
matches = re.findall(RE_HTML_A_TAG_HREF, line)
Expand Down

0 comments on commit 89e9e58

Please sign in to comment.