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