Skip to content

Commit

Permalink
Don't match greedily up to latest closing bracket
Browse files Browse the repository at this point in the history
That would include too much into the supposed link that we're testing.
  • Loading branch information
Ghostkeeper committed Dec 7, 2019
1 parent de7ea0f commit e87cb1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_images(self):
"""
Test if the links to images are correct.
"""
find_images = re.compile(r"!\[.*\]\((.+)\)")
find_images = re.compile(r"!\[.*\]\(([^\)]*)\)")
for filename in self.all_articles():
with self.subTest():
with open(filename) as f:
Expand All @@ -45,7 +45,7 @@ def test_articles(self):
"""
Test if the links to other articles are correct.
"""
find_links = re.compile(r"\[.*\]\((.+)\)")
find_links = re.compile(r"\[.*\]\(([^\)]*)\)")
for filename in self.all_articles():
with self.subTest():
with open(filename) as f:
Expand Down

0 comments on commit e87cb1b

Please sign in to comment.