Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test containing both open and close brackets in external link #658

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading