Skip to content

Commit

Permalink
refactor: Don't consider words containing digits
Browse files Browse the repository at this point in the history
Issue #1: #1
  • Loading branch information
pawamoy committed Jan 29, 2022
1 parent e69bee0 commit 42d42f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mkdocs_spellcheck/words.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def _strip_tags(html, ignore_code):

not_letters_nor_spaces = re.compile(r"[^\w\s-]")
dashes_or_spaces = re.compile(r"[-\s]+")
number = re.compile("[0-9]+")


def _slugify(value, allow_unicode=False):
Expand All @@ -57,7 +56,12 @@ def _slugify(value, allow_unicode=False):


def _keep_word(word, min_length):
return not word.isdigit() and len(word) >= min_length
if len(word) < min_length:
return False
for char in word:
if char.isdigit():
return False
return True


def get_words(
Expand Down

0 comments on commit 42d42f1

Please sign in to comment.