Replace em dash in serialize-dialog.js comment w/ ASCII dash#2203
Open
davidrunger wants to merge 1 commit intopercy:masterfrom
Open
Replace em dash in serialize-dialog.js comment w/ ASCII dash#2203davidrunger wants to merge 1 commit intopercy:masterfrom
davidrunger wants to merge 1 commit intopercy:masterfrom
Conversation
The em dash (U+2014 EM DASH) being replaced in this change with a simple dash (U+002D HYPHEN-MINUS) causes a problem for me (and maybe/probably other people). The em dash ultimately causes Ruby's HTTP library (which I use via the `percy-capybara` gem) to interpret a certain HTTP response from the Percy server as having a binary encoding, rather than a UTF-8 encoding, which then causes a warning from the `json` gem (`/home/runner/work/david_runger/david_runger/vendor/bundle/ruby/4.0.0/gems/json-2.19.4/lib/json/common.rb:445: warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0`). Replacing the em dash with a simple ASCII dash avoids this issue. The non-ASCII dash was introduced in the latest released Percy version (1.31.12) via percy#2185.
Author
|
As a side note, I see that the bottom of the PR #2185 that introduced the issue that this PR aims to correct states:
I certainly appreciate that transparency! LLMs are well known for their fondness for em dashes. If it is possible to take some measure to minimize the likelihood of LLM agents such as Claude Code from introducing em dashes into code (e.g. by adding an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The em dash (U+2014 EM DASH) being replaced in this change with a simple dash (U+002D HYPHEN-MINUS) causes a problem for me (and maybe/probably other people). The em dash ultimately causes Ruby's HTTP library (which I use via the
percy-capybaragem) to interpret a certain HTTP response from the Percy server as having a binary encoding, rather than a UTF-8 encoding, which then causes a warning from thejsongem (/home/runner/work/david_runger/david_runger/vendor/bundle/ruby/4.0.0/gems/json-2.19.4/lib/json/common.rb:445: warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0).Replacing the em dash with a simple ASCII dash avoids this issue.
The non-ASCII dash was introduced in the latest released Percy version (1.31.12) via #2185.