-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text is cut before the end #4
Comments
Hi @neywen, sorry for the late reply. Had a very intense business trip and was barely available. Was trying to reproduce the bug, with no luck unfortunately. Could you elaborate, please, and send the whole file? Best, |
I'm having a similar issue, and it might be caused by the same problem: Windows-style line breaks, i.e. \r\n rather than just \n. I believe this is also the HTML standard, so it's not uncommon. Here's some sample code that demonstrates the problem in the current 1.0.0-alpha2 tag: import Markdown
let test1 = "Testing1.\n\nTesting2."
let test2 = "Testing1.\r\n\r\nTesting2."
if let result1 = try? Markdown(string: test1) {
if let doc1 = try? result1.document() {
print(doc1)
}
}
if let result2 = try? Markdown(string: test2) {
if let doc2 = try? result2.document() {
print(doc2)
}
} That prints the following: <p>Testing1.</p>
<p>Testing2.</p>
<p>Testing1.</p>
<p>Testing</p> Note the final In my tests locally just replacing \r\n with \n before handing it to |
@twostraws Thanks a lot for the example! Is there any chance you could make a PR with an automatic test for this? |
I use the library to display a "terms and conditions" text.
The generated document is cut before the end of the source text.
the debug process:
let contents = try NSString(contentsOfFile: filepath, usedEncoding: nil) as String
gives:gives :
The text was updated successfully, but these errors were encountered: