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

Backslash character escapes two following characters #55

Open
GoogleCodeExporter opened this issue Sep 1, 2015 · 3 comments
Open

Backslash character escapes two following characters #55

GoogleCodeExporter opened this issue Sep 1, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

> c.makeHtml('\\.**foo**');
Actual:   '<p>.*<em>foo</em>*</p>'
Expected: '<p>.<strong>foo</strong></p>'

> c.makeHtml('\\***foo**\\*');
Actual:   '<p>**<em>foo</em>**</p>'
Expected: '<p>*<strong>foo</strong>*</p>'

> c.makeHtml('\\[*a*\\](b)');
Actual:   '<p>[*a*](b)</p>'
Expected: '<p>[<em>a</em>](b)</p>'


Tested on c245b9e.

Original issue reported on code.google.com by pkoszulinski on 7 Apr 2013 at 7:30

@GoogleCodeExporter
Copy link
Author

Hmm yeah, that's because the escape code ends with a letter. I suppose it makes 
sense to end it with a non-letter, at least in most cases.

You can apply the attached patch if you want this fixed quickly, but note that 
it's not extensively tested. I'll also have to make a similar change to 
https://code.google.com/p/markdownsharp/ (the two projects have to be in sync), 
so it may take a bit.

Original comment by [email protected] on 8 Apr 2013 at 6:49

  • Changed state: Accepted

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for quick patch. I'll test it in the meantime.

Original comment by pkoszulinski on 8 Apr 2013 at 9:00

@GoogleCodeExporter
Copy link
Author

You shouldn't deploy it to a production environment; I later realized it breaks 
in some rather obvious edge cases:

c.makeHtml('~D~')
"<p>~T$T~</p>"

Original comment by [email protected] on 8 Apr 2013 at 12:25

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

No branches or pull requests

1 participant