Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Tags in HTML attributes parsed for indentation purposes #229

Open
wbt opened this issue Jun 7, 2019 · 1 comment
Open

Tags in HTML attributes parsed for indentation purposes #229

wbt opened this issue Jun 7, 2019 · 1 comment

Comments

@wbt
Copy link

wbt commented Jun 7, 2019

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

  1. In Atom, create a new HTML file. (Optionally configure 1 indent = 4 spaces).
  2. 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>
  1. Select All.
  2. 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 &lt;Pending&gt; 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

@rsese
Copy link

rsese commented Jun 10, 2019

Thanks again for reporting 👍 Reproduced with 1.39.0-nightly21 on macOS 10.12.6.

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

No branches or pull requests

2 participants