mathiasbynens / he

A robust HTML entity encoder/decoder written in JavaScript.
https://mths.be/he
MIT License
3.43k stars 255 forks source link

Added ' character to escapeMap #36

Closed smartapant closed 8 years ago

smartapant commented 8 years ago

' wasn't supported

codecov-io commented 8 years ago

Current coverage is 96.64%

Merging #36 into master will not affect coverage as of 7ebb7cb

@@            master     #36   diff @@
======================================
  Files            1       1       
  Stmts          149     149       
  Branches         0       0       
  Methods          0       0       
======================================
  Hit            144     144       
  Partial          0       0       
  Missed           5       5       

Review entire Coverage Diff as of 7ebb7cb

Powered by Codecov. Updated on successful CI builds.

mathiasbynens commented 8 years ago

' wasn't supported

What do you mean? Can you provide a test case that fails with the current implementation?

smartapant commented 8 years ago

@mathiasbynens my bad, i've run into an issue and this fix doesn't work, so this pull request should not be merged

mathiasbynens commented 8 years ago

What is the issue?

smartapant commented 8 years ago

@mathiasbynens in string like that: <div class="md"><p>I haven&#39;t seen this posted in awhile :)</p></div>

after decoding it "I haven't" is left

i was unattentive enough not to notice that ' was originally &#39;

what can be wrong?

smartapant commented 8 years ago

@mathiasbynens the strings are reddit comments, maybe they were encoded wrongly, they become decoded properly after 2 decode calls in a row :)