-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
<button> with force-expand-multiline formatting bug #1335
Comments
Some changes have occured between the merge of the PR which introduced this feature (#1070) and now meaning this feature is now broken. The tests for this (at today's date) no longer match the original expected behaviour: The test should be as below: opts.wrap_attributes = 'force-expand-multiline';
opts.wrap_attributes_indent_size = 4;
opts.wrap_line_length = 80;
test_fragment('<div >This is some text</div>', '<div>This is some text</div>');
test_fragment('<div attr="123" >This is some text</div>', '<div attr="123">This is some text</div>');
test_fragment(
'<div attr0 attr1="123" data-attr2="hello t here">This is some text</div>',
// -- output --
'<div\n' +
' attr0\n' +
' attr1="123"\n' +
' data-attr2="hello t here"\n' +
'>\n' +
' This is some text\n' +
'</div>'); |
@blemaire But I'm not sure I understand your comment about the tests. Looking at the tests in the original PR they look to me like the first code that you list and not what you think they should look like. |
I could be wrong about the tests, the formatting has been changed a lot so somewhat difficult to read. I attempted a fix on this issue but changes are not without many side effects :( |
@blemaire Yeah, That is a problem with the html beautifier especially right now. |
I am having trouble with getting As an example, for this simple code snippet the formatting (indentation) does not work properly:
But if I change the parent element to a
This is my config file:
I am using the vscode extension Beautify version 1.3 which in turn uses js-beautify 1.7.5 |
Looks like this is fixed in 1.8.0-rc6. |
Description
Input
The code looked like this before beautification:
Expected Output
The code should have looked like this after beautification:
Actual Output
The code actually looked like this after beautification:
Environment
OS: MacOS
Settings
I'm using all the default values apart from the below:
The text was updated successfully, but these errors were encountered: