Skip to content

Commit

Permalink
Fix emoji not ending case
Browse files Browse the repository at this point in the history
  • Loading branch information
lukakerr committed May 23, 2019
1 parent e15f6de commit 64a89d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/cmark_gfm/emoji.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ static cmark_node *match(cmark_syntax_extension *self, cmark_parser *parser,
// Go past last :
if (data[end] == ':') {
end++;
} else {
return NULL;
}

if (end == at) {
Expand Down
2 changes: 1 addition & 1 deletion cmark-gfm-swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
29C28E302070A6B9002C19F7 /* checkbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = checkbox.c; sourceTree = "<group>"; };
29C28E372070A6F4002C19F7 /* cmark_gfm_swiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = cmark_gfm_swiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
29C28E3B2070A6F4002C19F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
29C28E422070A70F002C19F7 /* Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
29C28E422070A70F002C19F7 /* Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; tabWidth = 4; };
A14D7F372230781400856121 /* emoji_list.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = emoji_list.h; sourceTree = "<group>"; };
A16320192235F6A3005FC8E0 /* wikilink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wikilink.h; sourceTree = "<group>"; };
A163201A2235F6A3005FC8E0 /* wikilink.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = wikilink.c; sourceTree = "<group>"; };
Expand Down
7 changes: 7 additions & 0 deletions cmark_gfm_swiftTests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ class Tests: XCTestCase {
XCTAssertEqual(html, "<p>Tropical 🌴</p>\n")
}

func testRenderBold_withColon() {
let markdown = "**i am a test:**"
let html = Node(markdown: markdown)!.html

XCTAssertEqual(html, "<p><strong>i am a test:</strong></p>\n")
}

func testRenderEmoji_withInvalidEmoji() {
let markdown = "This is :notvalidemoji:"
let html = Node(markdown: markdown)!.html
Expand Down

0 comments on commit 64a89d9

Please sign in to comment.