Skip to content
Snippets Groups Projects
Commit 431926d3 authored by Campbell Barton's avatar Campbell Barton
Browse files

check_spelling: filter out URL's

parent e9c84f42
No related branches found
No related tags found
No related merge requests found
...@@ -55,10 +55,15 @@ from check_spelling_c_config import ( ...@@ -55,10 +55,15 @@ from check_spelling_c_config import (
import re import re
re_vars = re.compile("[A-Za-z]+") re_vars = re.compile("[A-Za-z]+")
re_url = re.compile(r'(https?|ftp)://\S+')
def words_from_text(text): def words_from_text(text):
""" Extract words to treat as English for spell checking. """ Extract words to treat as English for spell checking.
""" """
# Strip out URL's.
text = re_url.sub(" ", text)
text = text.strip("#'\"") text = text.strip("#'\"")
text = text.replace("/", " ") text = text.replace("/", " ")
text = text.replace("-", " ") text = text.replace("-", " ")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment