Lines are not un-indented correctly when attributes are wrapped
See original GitHub issueDescription
Indenting is broken whenever attribute wrapping happens.
Using js-beautify v1.6.8.
Input
The code looked like this before beautification:
<div first second>content</div>
<div>content</div>
Expected Output
The code should have looked like this after beautification:
<div first
second>content</div>
<div>content</div>
Actual Output
The code actually looked like this after beautification:
<div first
second>content</div>
<div>content</div>
Steps to Reproduce
Beautify the code
Environment
OS: MacOS
Settings
Example:
{
"wrap_attributes": "force-aligned"
}
Note: wrap_attributes doesn’t have to be set to force-aligned. Any wrapping (excluding “force-expand-multiline”) introduces, including if “auto” caused the wrapping will demonstrate this issue.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:9
- Comments:23 (10 by maintainers)
Top Results From Across the Web
Intellij idea indent on wrap - formatting - Stack Overflow
You have to un-tick the Align attributes in order to have continuation indentation to work. enter image description here.
Read more >text-indent - CSS: Cascading Style Sheets - MDN Web Docs
Inverts which lines are indented. All lines except the first line will be indented.
Read more >textwrap — Text wrapping and filling — Python 3.11.1 ...
Counts towards the length of the first line. The empty string is not indented. (default: '' ) String that will be prepended to...
Read more >CSS text-indent property - W3Schools
The text-indent property specifies the indentation of the first line in a text-block. Note: Negative values are allowed. The first line will be...
Read more >Topic: html / css for hanging indent (poetry) - WordPress.com
If your paragraph is not wrapped in p-tags, add those, and in the opening p-tag, add the following attribute: style="text-indent: 20px;.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found the problem. Fixing now.
Same here, the code just keeps getting more and more indented up until the last moment. It’s impossible to use this beautifier anymore like this, I have to manually format the code 😕