dreamwieber / AttributedMarkdown

Native Markdown Parsing to NSAttributedString on iOS
Other
412 stars 71 forks source link

Parsing error #9

Open mps opened 11 years ago

mps commented 11 years ago

When I attempt to parse a NSString that contains a '<' or '>' then I end up getting a crash in memory (BAD_EXEC_ACCESS).

Is this a known issue?

Thanks

Example (edit to view raw text, GH formats it as markdown):

On Apr 16, 2013, at 7:56 PM, Matthew Strickland notifications@github.com wrote:

Test

— Reply to this email directly or view it on GitHub.

dreamwieber commented 11 years ago

I'm not able to reproduce this. Maybe you could post a gist or some more details about what you're doing with your string? Or a stack trace?

mrardon commented 11 years ago

I just experienced this issue as well, was stumped until I saw this issue. Here is the text I am using

AppName

Created by <email@someaddress.com>
mps commented 11 years ago

https://gist.github.com/mps/5415670#file-gistfile1-m

mps commented 11 years ago

@dreamwieber the problem appears to be here: https://github.com/dreamwieber/AttributedMarkdown/blob/master/markdown_output.m#L196

because it is parsing the markdown as a URL <matthew@idlefusion.com> but it is really null.

/cc @mrardon

dreamwieber commented 11 years ago

Thanks -- I'll look into it.

Sent from my iPhone

On Apr 18, 2013, at 12:53 PM, Matthew Strickland notifications@github.com wrote:

@dreamwieber the problem appears to be here: https://github.com/dreamwieber/AttributedMarkdown/blob/master/markdown_output.m#L196

because it is parsing the markdown as a URL matthew@idlefusion.com but it is really null.

/cc @mrardon

— Reply to this email directly or view it on GitHub.

dreamwieber commented 11 years ago

URL support is somewhat experimental -- it's not officially supported as an NSAttributedString attributed yet on iOS, so I think it's quite possibly the cause. I did notice that the brackets seem irrelevant to the crash. It looks like the @ symbol inside the brackets is what triggers it. (I am having a hard time deciphering the string in your example @mps )

It may be a little while until I can track this down. If you're able to build the library yourself from source, you may be able to work around it temporarily by commenting out the URL code linked to by @mps.

mrardon commented 11 years ago

Just as a note I was able to get (email@somewhere.com) (with parens not angle brackets) to work as I didn't really need a link, just an email address in plaintext.

So it may not be just the @ sign but may be the combination of @.

Thanks

mps commented 11 years ago

Thanks for the heads up

mps commented 11 years ago

For now I have gone ahead and just replaced the appropriate strings before setting them. :+1:

dreamwieber commented 11 years ago

Definitely appears to be specifically related to the brackets AND the @ symbol.

I dug around today, but couldn't figure the root cause. I'll have to see how the peg-markdown library behaves with that input string...

Sent from my iPhone

On Apr 19, 2013, at 10:42 AM, Matt Rardon notifications@github.com wrote:

Just as a note I was able to get (email@somewhere.com) to work as I didn't really need a link, just an email address in plaintext.

So it may not be just the @ sign but may be the combination of @.

Thanks

— Reply to this email directly or view it on GitHub.

mps commented 11 years ago

+1 @dreamwieber

Any plans to support emoji ala github?

dreamwieber commented 11 years ago

Not yet, but feel free to open an 'enhancement' ticket for it.

On Fri, Apr 19, 2013 at 4:05 PM, Matthew Strickland < notifications@github.com> wrote:

+1 @dreamwieber https://github.com/dreamwieber

Any plans to support emoji ala github?

— Reply to this email directly or view it on GitHubhttps://github.com/dreamwieber/AttributedMarkdown/issues/9#issuecomment-16694182 .