Skip to content

Commit ad70ff3

Browse files
committed
Fixed issue with string length
1 parent 4ba232b commit ad70ff3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

SwiftHoedownTests/SwiftHoedownTests.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ class SwiftHoedownTests: XCTestCase {
1717
XCTAssertEqual(html, "<h1>Header 1</h1>\n")
1818
}
1919

20-
func testSmartQuotes() {
20+
func testCurlyQuotes() {
2121
let markdown = "“This is a quote”\nFollowed by some text"
2222
let html = Hoedown.renderHTMLForMarkdown(markdown, flags: .None, extensions: .None)
2323
XCTAssertEqual(html, "<p>“This is a quote”\nFollowed by some text</p>\n")
24-
// FAILS: This seems to be an issue with Hoedown. See: https://github.com/hoedown/hoedown/issues/179
2524
}
2625
}

source/Hoedown.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class HoedownDocument {
4242

4343
public func renderMarkdown(string: String, bufferSize: UInt = 16) -> String? {
4444
let buffer = hoedown_buffer_new(Int(bufferSize))
45-
hoedown_document_render(self.internalDocument, buffer, string, string.characters.count);
45+
hoedown_document_render(self.internalDocument, buffer, string, string.utf8.count);
4646

4747
let htmlOutput = hoedown_buffer_cstr(buffer)
4848
let output = String.fromCString(htmlOutput)

0 commit comments

Comments
 (0)