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

Escape double quotes in attribute values in HTMLElement plugin #3797

Merged
merged 2 commits into from
Jun 27, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Another breaking change. A few more to come. Unlike ReactElement and ReactTestComponent plugins, which call print function to escape double quotes

<div
  title="\"escape\""
/>

a new test for HTMLElement plugin fails before I replace template literal with print function:

<div
-  title="\"escape\""
+  title=""escape""
/>

Proposed: To push correctness, consistency, and performance, let’s refactor common code from HTMLElement, ReactElement, and ReactTestComponent in 3 steps:

  1. printProps
  2. printChildren
  3. printElement

What do you think of pretty-format/src/plugins/lib/markup.js as a file name?

Test plan

Added a test

@codecov-io
Copy link

codecov-io commented Jun 12, 2017

Codecov Report

Merging #3797 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3797   +/-   ##
=======================================
  Coverage   58.01%   58.01%           
=======================================
  Files         195      195           
  Lines        6741     6741           
  Branches        6        6           
=======================================
  Hits         3911     3911           
  Misses       2827     2827           
  Partials        3        3
Impacted Files Coverage Δ
packages/pretty-format/src/plugins/html_element.js 94.11% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1199558...b70dd00. Read the comment docs.

@cpojer
Copy link
Member

cpojer commented Jun 26, 2017

Please rebase

@pedrottimark
Copy link
Contributor Author

Yes

@cpojer cpojer merged commit c9598ff into jestjs:master Jun 27, 2017
@pedrottimark pedrottimark deleted the escape-html-attributes branch June 27, 2017 19:36
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants