Skip to content

Commit

Permalink
Add test containing both open and close brackets in external link
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbonothing64 committed Apr 18, 2024
1 parent 7f9dc01 commit 961e7f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions verto/tests/ExternalLinkTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ def test_trailing_question_mark(self):
expected_string = self.read_test_file(self.processor_name, 'trailing_question_mark_expected.html', strip=True).strip()
self.assertEqual(expected_string, converted_test_string)

def test_both_brackets(self):
'''Tests path containing both ().'''
test_string = self.read_test_file(self.processor_name, 'both_brackets.md')

processor = ExternalLinkPattern(self.ext, self.md.parser)
self.assertIsNotNone(re.search(processor.compiled_re, test_string))

converted_test_string = markdown.markdown(test_string, extensions=[self.verto_extension])
expected_string = self.read_test_file(self.processor_name, 'both_brackets_expected.html', strip=True).strip()
self.assertEqual(expected_string, converted_test_string)

def test_multiple_links(self):
'''Tests that multiple links are processed.'''
test_string = self.read_test_file(self.processor_name, 'multiple_links.md')
Expand Down
1 change: 1 addition & 0 deletions verto/tests/assets/external-link/both_brackets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check out this [website](https://en.wikipedia.org/wiki/Entropy_(information_theory)).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Check out this <a href="https://en.wikipedia.org/wiki/Entropy_(information_theory)" target="_blank">website</a>.</p>

0 comments on commit 961e7f8

Please sign in to comment.