config->set('AutoFormat.Linkify', true);
}
public function testLinkifyURLInRootNode()
{
$this->assertResult(
'http://example.com',
'http://example.com'
);
}
public function testLinkifyURLInInlineNode()
{
$this->assertResult(
'http://example.com',
'http://example.com'
);
}
public function testBasicUsageCase()
{
$this->assertResult(
'This URL http://example.com is what you need',
'This URL http://example.com is what you need'
);
}
public function testIgnoreURLInATag()
{
$this->assertResult(
'http://example.com/'
);
}
public function testNeeded()
{
$this->config->set('HTML.Allowed', 'b');
$this->expectError('Cannot enable Linkify injector because a is not allowed');
$this->assertResult('http://example.com/');
}
public function testExcludes()
{
$this->assertResult('http://example.com');
}
public function testRegexIsSmart()
{
$this->assertResult('http://example.com/foo.', 'http://example.com/foo.');
$this->assertResult('“http://example.com/foo”', '“http://example.com/foo”');
$this->assertResult('“http://example.com”', '“http://example.com”');
$this->assertResult('(http://example.com/f(o)o)', '(http://example.com/f(o)o)');
}
}
// vim: et sw=4 sts=4