Skip to content

Commit a8e4bab

Browse files
committed
InvalidLinkBear: Stop at <
Related: #691
1 parent 28978f6 commit a8e4bab

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

bears/general/InvalidLinkBear.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_status_code(url, timeout):
4242
def find_links_in_file(file, timeout, ignore_regex):
4343
ignore_regex = re.compile(ignore_regex)
4444
regex = re.compile(
45-
r'((ftp|http)s?://\S+\.(?:[^\s()\'\">|]+|'
45+
r'((ftp|http)s?://\S+\.(?:[^\s()\'\"<>|]+|'
4646
r'\([^\s()]*\))*)(?<!\.)(?<!,)')
4747
for line_number, line in enumerate(file):
4848
match = regex.search(line)

tests/general/InvalidLinkBearTest.py

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_run(self):
8888
http://httpbin.org/status/204.....
8989
[httpbin](http://httpbin.org/status/200)
9090
|http://httpbin.org/status/200|
91+
<h3>Something http://httpbin.org/status/200</h3>
9192
9293
# Not a link
9394
http://not a link dot com

0 commit comments

Comments
 (0)