Skip to content

olivertappin/sort-attributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sort-attributes package

Sorts selected HTML attributes in alphabetical order.

Usage

Highlight the HTML you would like to sort and choose 'Sort Attributes: Convert' from the Command Palette. Alternatively, use the keyboard shortcut F5.

Screenshot video example

Support

Currently, this package only supports full HTML selections. If you select an incomplete HTML selection, such as <a href="#">, end tags will be added for you. Certain characters within the HTML attribute values will also be encoded with HTML entities (such as PHP opening tags). Support for decoding of these values are planned to be released in future versions.

Examples

Please see the following examples where this package will easily sort HTML attributes in alphabetical order:

Anchor tag with content

<a href="#" class="anchor">Click me</a>

Input tag (self closing)

<input type="email" class="form__input" placeholder="Email address">

Navigation tag with children

<nav id="nav" class="nav">
    <ul>
        <li><a href="#">Link 1</a></li>
        <li><a href="#">Link 2</a></li>
        <li><a href="#">Link 3</a></li>
    </ul>
</nav>

About

Atom package to sort HTML attributes alphabetically

Resources

License

Stars

Watchers

Forks

Packages

No packages published