You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix emoji rendering in code blocks with UTF-8 decoding and emoji fonts (#79)
* Initial plan
* Initial plan for fixing emoji rendering
Co-authored-by: dwjohnston <2467377+dwjohnston@users.noreply.github.com>
* Fix emoji rendering by adding emoji-capable fonts to code blocks
Co-authored-by: dwjohnston <2467377+dwjohnston@users.noreply.github.com>
* Add example story to the proper story.
* Add example fix.
* Replace deprecated escape() with proper UTF-8 decoding using TextDecoder
The escape/unescape pattern works but uses deprecated methods. This replaces it with the modern TextDecoder API which properly handles UTF-8 multi-byte characters like emojis.
Why the deprecated pattern worked:
- atob() decodes base64 but treats bytes as Latin-1
- escape() percent-encodes the malformed string
- decodeURIComponent() interprets percent-encoded bytes as UTF-8
Modern solution:
- atob() decodes base64 to binary string
- Convert to Uint8Array byte array
- TextDecoder properly interprets bytes as UTF-8
Added comprehensive tests verifying both patterns give identical results.
Co-authored-by: dwjohnston <2467377+dwjohnston@users.noreply.github.com>
* Add note to document AI generated code
* Create sharp-pianos-hammer.md
* Update test
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dwjohnston <2467377+dwjohnston@users.noreply.github.com>
Co-authored-by: David Johnston <david@blacksheepcode.com>
0 commit comments