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

Alternate formatting for wrapping attributes #832

Closed
timkelty opened this issue Dec 15, 2015 · 6 comments
Closed

Alternate formatting for wrapping attributes #832

timkelty opened this issue Dec 15, 2015 · 6 comments

Comments

@timkelty
Copy link

Currently, js-beautify does this

<input type="hidden"
  name="theName"
  value="">

I'm looking for a set of options that achieves this:

<input
  type="hidden"
  name="theName"
  value=""
>
@timkelty
Copy link
Author

I suppose this could be 2 settings:

  • wrap_attributes: 'all' ?
  • close_tag_with_wrapped_attributes_on_new_line: true

@bitwiseman
Copy link
Member

close_tag_with_wrapped_attributes_on_new_line would be a new setting, right?

@timkelty
Copy link
Author

Or something to that effect, yes.

The wrap_attributes may also be better as something like multiple. Ideally I'd only want attributes on multiple lines when there are more than 1.

This:

<input type="hidden">
<input type="hidden" name="theName" value="">

Beautified to this:

<input type="hidden">
<input
  type="hidden"
  name="theName"
  value=""
>

@timkelty
Copy link
Author

Or maybe even a new wrap_attributes_threshold setting.

@bitwiseman
Copy link
Member

That would be a different enhancement. 😄 One thing at time.

@bitwiseman
Copy link
Member

This exists now. It is call force-expand-multiline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants