This website requires JavaScript.
Explore
Help
Sign In
vitalif-js
/
prettier
Watch
1
Star
0
Fork
You've already forked prettier
0
Code
Issues
Pull Requests
Projects
Releases
Wiki
Activity
400f34624f
prettier
/
tests
/
jsx
/
jsfmt.spec.js
2 lines
54 B
JavaScript
Raw
Normal View
History
Unescape
Escape
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 17:55:50 +03:00
run
_spec
(
_
_dirname
,
null
,
[
"babylon"
,
"typescript"
]
)
;