is($s, qq(hello <a\nhref="$u">$u</a> world), "root + fragment");
}
+# Markdown compatibility
+{
+ my $l = PublicInbox::Linkify->new;
+ my $u = 'http://example.com/';
+ my $s = "[markdown]($u)";
+ $s = $l->linkify_1($s);
+ $s = $l->linkify_2($s);
+ is($s, qq![markdown](<a\nhref="$u">$u</a>)!, 'Markdown-compatible');
+
+ $s = qq![markdown]($u "title")!;
+ $s = $l->linkify_1($s);
+ $s = $l->linkify_2($s);
+ is($s, qq![markdown](<a\nhref="$u">$u</a> "title")!,
+ 'Markdown title compatible');
+
+ $s = qq![markdown]($u).!;
+ $s = $l->linkify_1($s);
+ $s = $l->linkify_2($s);
+ is($s, qq![markdown](<a\nhref="$u">$u</a>).!,
+ 'Markdown-compatible end of sentence');
+}
+
done_testing();