Skip to content

Commit 0b859b5

Browse files
committed
#114 Added automatic link recognition test for @ sybmols
1 parent c9d594d commit 0b859b5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Tests/MMLinkTests.m

+9
Original file line numberDiff line numberDiff line change
@@ -324,5 +324,14 @@ - (void)testReferenceLinkWithNoReference
324324
MMAssertMarkdownEqualsHTML(@"[Foo][bar]", @"<p>[Foo][bar]</p>");
325325
}
326326

327+
- (void)testLinkRecognitionWithAtSymbol
328+
{
329+
// Use a string comparison for this test because the output is not valid XML
330+
NSString *markdown = @"Have you seen this medium link? https://medium.com/@philipla/the-two-types-of-product-virality-8ae744b1c4d7 It's Great";
331+
NSString *generated = [MMMarkdown HTMLStringWithMarkdown:markdown extensions:MMMarkdownExtensionsAutolinkedURLs error:nil];
332+
NSString *expected = @"<p>Have you seen this medium link? <a href=\"https://medium.com/@philipla/the-two-types-of-product-virality-8ae744b1c4d7\">https://medium.com/@philipla/the-two-types-of-product-virality-8ae744b1c4d7</a> It's Great</p>\n";
333+
XCTAssertEqualObjects(generated, expected, @"HTML didn't match expected value");
334+
}
335+
327336

328337
@end

0 commit comments

Comments
 (0)