prettier/tests/jsx
Davy Duperron d1191adce6 Fix ampersand in jsx href and src (#1056)
* Add exceptions for html escape usage in href and src attributes.

* Add new test cases.

* Remove useless spaces.

* Do not escape if the parser does not do so.

* Implement a different heuristic for keeping along with the parser.

* Update tests.

* Forgot passing options as param.

* Experimental alternative implementation.

* Remove other function.

* Push test after merge.

* Update getJsXRawValue in order to return the unprocessed raw value.

Latest Babylon version includes a fix that allow us to directly
inject the unprocessed raw value available in the `extra.rawValue`
property of the node. A last transformation is applied by replacing
double quotes to `"` entities.

* Drop unused htmlEscapeInsideDoubleQuote function.

* Move getJSXRawValue function logic to the its only call, drop it.

A simple check is performed to determine if the parser is babylon or
flow via `n.value.extra`. Thus, the corresponding raw value is
extracted. If we are converting a string from single quotes to
double quotes, we need to make sure that double quotes are converted
to ".

* Remove ambiguous comment.

* Add Babylon parser.

* Update test cases accordingly, revert regression introduced previously.
2017-04-08 07:55:50 -07:00
..
__snapshots__ Fix ampersand in jsx href and src (#1056) 2017-04-08 07:55:50 -07:00
expression.js [JSX] Don't wrap JSX Elements in parentheses if they are inside JSX Expression Containers (#845) 2017-03-01 12:05:57 -08:00
html_escape.js Fix ampersand in jsx href and src (#1056) 2017-04-08 07:55:50 -07:00
hug.js Inline BinaryExpressions inside JSXExpression (#965) 2017-03-09 07:59:53 -08:00
jsfmt.spec.js Fix ampersand in jsx href and src (#1056) 2017-04-08 07:55:50 -07:00
object-property.js 565 jsx parentheses fix (#580) 2017-02-02 16:25:34 -08:00
open-break.js [JSX] Break if opening element breaks (#942) 2017-03-07 17:19:05 -08:00
parens.js Fix ampersand in jsx href and src (#1056) 2017-04-08 07:55:50 -07:00
quotes.js Always use double quotes for JSX and properly escape 2017-01-11 11:40:24 -08:00