Skip to content

Expand documentation of escapeJSON#250

Merged
RyanGlScott merged 1 commit intohaskell:masterfrom
considerate:considerate/escape-code-documentation
Dec 8, 2021
Merged

Expand documentation of escapeJSON#250
RyanGlScott merged 1 commit intohaskell:masterfrom
considerate:considerate/escape-code-documentation

Conversation

@considerate
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread Criterion/Report.hs Outdated
Comment thread Criterion/Report.hs Outdated
Comment thread Criterion/Report.hs Outdated
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
Copy Markdown
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