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

Preserve attributes line break in HTML #455

Closed
kentliau opened this issue Apr 26, 2014 · 23 comments
Closed

Preserve attributes line break in HTML #455

kentliau opened this issue Apr 26, 2014 · 23 comments

Comments

@kentliau
Copy link

like this

  <div id="anId"
       name="aName"
       class="aClass"
       onclick="alert('hello')"
       ondblclick="alert('hello')">asdf</div>

  <input type="text"
         name="aName"
         class="aClass"
         id="anId">
@bitwiseman
Copy link
Member

Please describe current output so we can see how it differs.

@kentliau
Copy link
Author

it will just concatenate into one line

  <div id="anId" name="aName" class="aClass" onclick="alert('hello')" ondblclick="alert('hello')">asdf</div>

  <input type="text" name="aName" class="aClass" id="anId">

could we have one more option to preserve line break of html attributes or line break within the angle bracket, plus auto align the first character of each attributes?

@sander76
Copy link

Would like to see this too...

@cutandpastey
Copy link

This would be pretty awesome 👍

@dam0
Copy link

dam0 commented Jan 15, 2015

+1

2 similar comments
@prathiraj
Copy link

+1

@gigablox
Copy link

+1

@bitwiseman
Copy link
Member

Good to know folks. Anyone want to take a swing at a PR?

@olmstd
Copy link

olmstd commented Jun 5, 2015

+1

3 similar comments
@frasator
Copy link

+1

@websirnik
Copy link

+1

@jfletcher-nuxeo
Copy link

+1

@bitwiseman bitwiseman added this to the 1.6.1 milestone Jan 29, 2016
@bitwiseman
Copy link
Member

@jfletcher-nuxeo, @websirnik , @frasator , @kentliau ,
I believe this is fixed in 1.6.0. Please take a look at the wrap_attributes settings.

@jfletcher-nuxeo
Copy link

So wrap_attributes=auto doesn't seem to do anything. What's the expected behavior? The code doesn't seem to do anything with that setting.

wrap_attributes=force does not completely address OP's issue. With this convention the indentation should be based on the position of the first attribute, not based on a fixed width. Maybe I'll make this a new issue.

EDIT: I see there are already some issues for this request, I'll update it.

@dmitry-saritasa
Copy link

agreed with @jfletcher-nuxeo , better to position by first attribute

@Deklin
Copy link

Deklin commented Jul 29, 2016

+1 to align with first attribute in the actual html element.

@phamhongphuc
Copy link

+1

1 similar comment
@fabioel
Copy link

fabioel commented Apr 21, 2017

+1

@jorgeramirez
Copy link

jorgeramirez commented May 11, 2017

did anyone solve this issue?

@bitwiseman
Copy link
Member

@jorgeramirez - See #1015. Does wrap_attributes = "force-aligned" work for you?

@Vortilion
Copy link

Any news on this issue? its quite annoying!

@bitwiseman
Copy link
Member

@Vortilion
This issue is closed fixed. What's your question? Please join us on Gitter if you want to chat.

@Vortilion
Copy link

Where can I do this? As far as I can see it here it’s not fixed? This option does nothing for me... it always formats the html attributes as one liner...ö

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