-
Notifications
You must be signed in to change notification settings - Fork 140
Tags in HTML attributes parsed for indentation purposes #229
Description
Description
When an HTML attribute string contains text that looks like an open tag, all following lines are indented one level more than they should be.
Steps to Reproduce
- In Atom, create a new HTML file. (Optionally configure 1 indent = 4 spaces).
- Write or paste code like the following:
<div>
<div>
<div>
<input type="text" value="Text that does not resemble a tag" />
</div>
<div>
<input type="text" value="<Pending>" />
</div>
</div>
</div>
- Select All.
- Auto-indent.
Expected behavior:
Code formatted like the sample above.
Actual behavior:
<div>
<div>
<div>
<input type="text" value="Text that does not resemble a tag" />
</div>
<div>
<input type="text" value="<Pending>" />
</div>
</div>
</div>
Note that everything after value="<Pending>" is indented one level more than it should be, and close div tags don't line up with their open div tags.
Adding a slash anywhere in the "Pending" not-a-tag and doing another auto-indent causes proper alignment. Replacing <Pending> with <Pending> is a better solution. However, it seems like Atom should still be able to indent this properly, by ignoring what's in the attribute string.
Reproduces how often:
Always, even in safe mode.
Versions
Atom : 1.23.2
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
Windows: 10 Pro