-
Notifications
You must be signed in to change notification settings - Fork 168
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
MMScanner assertion is firing unexpectedly and crashing app #47
Comments
OK, I found a test case which repros the crash every time:
It appears to be the leading space on the line before the '#'. The input "#H" is fine, no crash. However just adding a leading space to create " #H" causes the assertion to fire and a crash. The Markdown "spec" (using the term spec lightly :-) ) at http://daringfireball.net/projects/markdown/syntax#header doesn't say that a paragraph can't begin with a '#' it just says that Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. So that seems to indicate that " #H" is legal Markdown. Please let me know how else I can help :-), but this test case repros the crash every time. Thanks again, I'm really like MMMarkdown! |
Thanks for the test case! This should be all fixed up now. |
My pleasure! And thank you so much for fixing it so quickly, that's awesome, I really appreciate it. Any chance of getting a 0.4.1 or 0.5 release with this fix in it? :-) I took over ownership of the Cocoapods pod spec in the pod specs repo, to help out, so I can update the version there once there's a new release. |
I just created 0.4.1 for this fix. |
Thanks! I just pushed the 0.4.1 pod spec to Cocoapods. |
Hi,
I'm interactively parsing Markdown from an NSTextView as the user types. Sometimes, rarely, I get an app crash (in debug mode) with the assertion in MMScanner.initWithString:lineRanges firing:
Here's the stack trace:
I'm invoking the parsing as follows:
Here's some sample input that crashes it:
This input doesn't crash it every time, but often it does. Well, this is the last input I logged before it crashed, so the actual input might have been off by 1 character +/-.
Any ideas?
I guess the assertion is firing because some kind of logical assumption is not holding in MMParser, but I feel like MMParser should be able to handle whatever input it gets, even if it's potentially invalid markdown.
I'm worried about what this is going to mean in a release build where the assertion won't fire - will some more serious issue cascade and really crash my app or will it just potentially mis-parse the markdown input (that would be OK if temporary and later user typing fixed it).
Sorry, I'm trying to create test case that repos this 100% of the time, but I'm having trouble doing so.
Please let me know how I can help. :-)
The text was updated successfully, but these errors were encountered: