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

Support for JSX #97

Closed
ghost opened this issue Feb 20, 2014 · 4 comments
Closed

Support for JSX #97

ghost opened this issue Feb 20, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 20, 2014

Support formatting of javascript files with JSX templates, http://facebook.github.io/react/docs/getting-started.html

Right now it's messing up the html and adding spaces around the < > tags

@jdavisclark
Copy link
Owner

Not going to be able to support this. JsFormat uses the upstream einars/js-beautify project to perform the actual formatting, which doesn't (and I seriously doubt ever will) support jsx.

Currently you can not use JsFormat in an arbitrary HTML file either for similar reasons, unless you first highlight the javascript you want to format. The same workaround might get you by, but I doubt it.

@bitwiseman
Copy link
Collaborator

See beautifier/js-beautify#385. As part of fixing that issue, it is likely that we'll ignore all non-javascript script tags, which would then also ignore the JSX scripts. While not "support", we at least then wouldn't break them.

@jdavisclark
Copy link
Owner

@bitwiseman good to know, thanks.

However, currently we are specifically using js-beautify and only support formatting javascript within html files if the user highlights the javascript first. Right now I don't plan on adding support for mixed html/js formatting, and if I did decide to I would want to go with an all python solution (it looks like beautify-html only has a javascript version right now).

@bitwiseman
Copy link
Collaborator

Ah, right forgot about that. Thanks!

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

No branches or pull requests

2 participants