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

Tags in HTML attributes parsed for indentation purposes #229

@wbt

Description

@wbt

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions