question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sorting of HTML attributes

See original GitHub issue

Description

Is there anyway to enable sorting of HTML attributes?

Input

<input class="input is-small"
            type="text"
            v-model="domainFilter"
            placeholder="search">

Expected Output

The code should have looked like this after beautification:

<input class="input is-small"
            placeholder="search"
            type="text"
            v-model="domainFilter">

Actual Output

The code actually looked like this after beautification:

<input class="input is-small"
            type="text"
            v-model="domainFilter"
            placeholder="search">

Steps to Reproduce

Just add some attributes

Environment

OS: Windows 10 Vs-Code Latest

Settings

{
    "editorconfig": true,
      "indent_size": 2,
      "wrap_attributes": "force-aligned",
      "wrap_attributes_indent_size": 2,
      "wrap_line_length": 80
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
bitwisemancommented, Aug 12, 2018

Html now tokenizes before formatting. This mean it would be much easier to implement this now if any one wants to.

1reaction
jonkricommented, Aug 16, 2019

It would be great to see support for this. I like to keep my attributes alphabetically ordered - it helps me finding the attributes faster. (This issue is, at least to me, somewhat related to #1084, which is about re-ordering CSS properties alphabetically.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to sort HTML elements by data-attribute ? - GeeksforGeeks
In this article, we sort the unordered list elements using the data attribute with variable values on which the elements are to be...
Read more >
Sort HTML attributes based on Alphabetical order
HTML Tidy's --sort-attributes option will sort attributes alphanumerically.
Read more >
Alphabetically sorting of attributes in html and css (inline css)
The best thing to finish reformating of HTML or CSS would be, that the attributes are sorted alphabetically, too. (decided by setting)
Read more >
HTML Attributes Sort (A-Z) - Code Beautify
Word sorter is very unique tool to Sort words Ascending as well as Descending. · This tool saves your time and helps to...
Read more >
mrmlnc/vscode-attrs-sorter: VS Code plugin for sorting of the ...
Sorting HTML and Pug/Jade attributes ; Install. Press F1 and select Extensions: Install Extensions . Search for and select attrs-sorter . ; Usage....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found