Skip to content
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

Issues with "&" in entities #6

Open
blommegard opened this issue Sep 13, 2013 · 2 comments
Open

Issues with "&" in entities #6

blommegard opened this issue Sep 13, 2013 · 2 comments
Labels

Comments

@blommegard
Copy link

I think this is an issue within markdown.h, but only tested it in the iOS lib and have not had the real time to debug property. Would be great to have another eye on it as well.

Works just fine in "normal" text but won't in entities.

The following markdown:
I love **AT&T**
results in:
I love AT&T (only AT is bolded)

"&" and "<" sure are special chars in markdown and I would guess it is something related to that: http://daringfireball.net/projects/markdown/syntax

@heydamianc
Copy link
Contributor

@blommegard

I'm not so sure that the issue is coming from libsoldout (markdown.{h,c}) at this point because of this particular case in char_entity which is called fairly early in the markdown parsing: https://github.com/Uncodin/bypass-core/blob/master/src/soldout/markdown.c#L582.

I also noticed that our parser.cpp file is missing an entity callback (which I had forgotten, but have been told before.

So, at this point, I am inclined to think that the bug is in the code surrounding libsoldout in bypass-core. Essentially that code handles all of libsoldout's parsing callbacks and assembles a "markdown tree" which is similar to the DOM in HTML. When that tree is built up, the particular block you would expect to get would be:

[I love][AT&T]
     \      `----- bold
      `----------- plain

…but it instead seems to be building up this:

[I love][AT][&T]
     \    \   `--- plain
      \    `------ bold
       `---------- plain

From a cursory read of markdown.c (particularly here, I'm not finding where the ampersand could affect the closing of the double emphasis.

@myell0w
Copy link
Contributor

myell0w commented Sep 13, 2013

I can't remember exactly, but a quick test showed that this issue is fixed (at least visually) in my branch. I believe it's this commit that fixed it:

myell0w/bypass-core@b4c9523

I'm afraid I don't have any more time to investigate atm since I'm preparing my release in the App Store, but that should give you guys a hint on where to look. Let me know if that's helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants