#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 8; use MarkdownParser; my $parser = MarkdownParser->new(); is( $parser->parse("[link text](http://example.com)"), "

link text

\n", "Simple link" ); is( $parser->parse("[link with spaces](https://example.com/path)"), "

link with spaces

\n", "Link with path" ); is( $parser->parse("![alt text](image.png)"), "

\"alt

\n", "Simple image" ); is( $parser->parse("![alt with spaces](http://example.com/image.jpg)"), "

\"alt

\n", "Image with URL" ); is( $parser->parse("[Click me](javascript:alert('XSS'))"), "

Click me

\n", "JavaScript protocol blocked in links" ); is( $parser->parse("[Click me](data:text/html,)"), "

Click me

\n", "Data protocol blocked in links" ); is( $parser->parse("![Image](javascript:alert('XSS'))"), "

Image

\n", "JavaScript protocol blocked in images" ); is( $parser->parse("![Image](file:///etc/passwd)"), "

Image

\n", "File protocol blocked in images" );