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

Expand documentation of escapeJSON #250

Conversation

considerate
Copy link
Contributor

As a follow up to #248 I added some documentation about why \0 is escaped and what to do if the escaped string is to be used in an HTML attribute.

In criterion the JSON-encoded string is used in a <script> tag as text (which is indicated in the comment) but I think it would be improper to leave the attribute case unclear, especially since the previous version tried to escape for this use case as well.

@considerate considerate force-pushed the considerate/escape-code-documentation branch from 05b4fab to 88c6b0b Compare December 8, 2021 18:15
Copy link
Member

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have some minor grammatical and spelling suggestions, but otherwise this LGTM.

Criterion/Report.hs Outdated Show resolved Hide resolved
Criterion/Report.hs Outdated Show resolved Hide resolved
Criterion/Report.hs Outdated Show resolved Hide resolved
A note about usage in HTML attributes is also left to make it
clear that there are cases where this escaping would not be
enough to ensure that the resulting string is properly escaped
for use in HTML.
@considerate considerate force-pushed the considerate/escape-code-documentation branch from b2f7c29 to 2c86cd0 Compare December 8, 2021 19:11
@considerate
Copy link
Contributor Author

Thanks! I have some minor grammatical and spelling suggestions, but otherwise this LGTM.

Thank you! I updated the documentation according to your comments.

@RyanGlScott RyanGlScott merged commit bb8c119 into haskell:master Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants