Files
allucanget.biz/tests/test_links.py
T
zwitschi 9f0a216c5e Add new templates and tests for improved functionality
- Created index.html template for the homepage with service cards and partner logos.
- Added page_from_md.html template for rendering pages from markdown.
- Developed services.html template detailing various services offered.
- Implemented tests for link handling in markdown, ensuring external links open in new tabs and internal links function correctly.
- Enhanced markdown parser tests to validate heading extraction, content rendering, and link safety.
- Introduced utility tests for template rendering, HTML minification, and JavaScript minification.

Co-authored-by: Copilot <copilot@github.com>
2026-05-02 13:05:43 +02:00

17 lines
486 B
Python

from lib.markdown_parser import markdown_to_html_lines
def test_external_link_gets_target_rel():
md = '[external](https://example.com)'
html = markdown_to_html_lines(md)
assert 'href="https://example.com"' in html
assert 'target="_blank"' in html
assert 'rel="noopener noreferrer"' in html
def test_internal_link_no_target():
md = '[internal](/about)'
html = markdown_to_html_lines(md)
assert 'href="/about"' in html
assert 'target=' not in html