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

[cmark] Some characters are escaped twice #99

Closed
1 task done
krummler opened this issue Aug 13, 2018 · 5 comments
Closed
1 task done

[cmark] Some characters are escaped twice #99

krummler opened this issue Aug 13, 2018 · 5 comments
Labels
bug cmark Issues in the underlying cmark lib enhancement

Comments

@krummler
Copy link

krummler commented Aug 13, 2018

First off, thanks for this great library!

  • I've searched other open/closed issues for duplicates before opening up this new issue.

Report

What did you do?

Entered multiple html-excaped characters into the content of a DownView

What did you expect to happen?

I expect characters to be rendered like their unescaped counterparts, for example:

  • & becomes &
  • " becomes "
  • &lt; becomes <

What happened instead?

Most characters seem to work fine, except for &gt; and &lt; (maybe there are more cases).

  • &amp; stays &amp; which renders as &
  • &quot; stays &quot; which renders as "
  • &lt; becomes &amp;lt; which renders as &lt;
  • &gt; becomes &amp;gt; which renders as &gt;
@iwasrobbed
Copy link
Collaborator

Thanks for filing this @krummler; this is an issue in the underlying cmark lib. We are using the stable version 0.28.3 so you'd need to file a feature request in the cmark repo.

Confirmed

&amp; Hello\n\n&quot; Hai\n\n&lt; Does that work\n\n&gt; Maybe

becomes

"<p>&amp; Hello</p>\n<p>&quot; Hai</p>\n<p>&amp;lt; Does that work</p>\n<p>&amp;gt; Maybe</p>\n"

@iwasrobbed iwasrobbed changed the title Some characters are being escaped twice [cmark] Some characters are escaped twice Nov 10, 2018
@iwasrobbed iwasrobbed added the cmark Issues in the underlying cmark lib label Nov 10, 2018
@krummler
Copy link
Author

krummler commented Nov 13, 2018

Hi Rob,

I made an issue: commonmark/cmark#276. I'll report back if there are any significant changes.

@phoney
Copy link
Contributor

phoney commented Nov 28, 2018

They deny they can reproduce this on the cmark project in that issue#276. The date that 0.28.3 PR was merged into Down is the same day as @iwasrobbed 's comments above (it says 18 days ago). When I attempt to reproduce this with Down 0.6.1 it seems to work correctly. I get

<p>&amp; Hello</p>\n<p>&quot; Hai</p>\n<p>&lt; Does that work</p>\n<p>&gt; Maybe</p>

which I think is correct. Is it possible this was fixed in the cmark update? Actually, I just checked and this bug is present in 0.5.2 and absent in 0.6.0 and later. So I think it's fixed.

screen shot 2018-11-28 at 4 14 27 pm

@iwasrobbed
Copy link
Collaborator

Thanks for checking @phoney! Please verify with the latest Down release and re-open this issue if it continues. It might just be an encoding issue if so @krummler

@krummler
Copy link
Author

Hi there, thanks for the feedback, it seems to work fine now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cmark Issues in the underlying cmark lib enhancement
Projects
None yet
Development

No branches or pull requests

3 participants