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.

HTML "select" tags have too much indentation

See original GitHub issue

HTML “select” tags have too much indentation.

Input

The code looked like this before beautification:

<select class="col-4 form-input" ng-model="info.dateRange" ng-init="info.dateRange = 'last24'">
        <option selected="selected" value="last24">{{"dashboard_records_text_7" | translate}}</option>
        <option value="last7">{{"dashboard_records_text_8" | translate}}</option>
        <option value="custom">{{"dashboard_records_text_9" | translate}}</option>
    </select>

Expected Output

The code should have looked like this after beautification:

<select class="col-4 form-input" ng-model="info.dateRange" ng-init="info.dateRange = 'last24'">
    <option selected="selected" value="last24">{{"dashboard_records_text_7" | translate}}</option>
    <option value="last7">{{"dashboard_records_text_8" | translate}}</option>
    <option value="custom">{{"dashboard_records_text_9" | translate}}</option>
</select>

Actual Output

The code actually looked like this after beautification:

<select class="col-4 form-input" ng-model="info.dateRange" ng-init="info.dateRange = 'last24'">
        <option selected="selected" value="last24">{{"dashboard_records_text_7" | translate}}</option>
        <option value="last7">{{"dashboard_records_text_8" | translate}}</option>
        <option value="custom">{{"dashboard_records_text_9" | translate}}</option>
    </select>

Environment

OS: Mac Version tested with: 1.6.7

Settings

Example:

var options = {
    "wrap_line_length": 80,
    "indent_handlebars": true
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
HookyQRcommented, Feb 10, 2017

select is an unformatted tag by default. This isn’t a bug. Add the following to your options:

	"unformatted": ["a", "abbr", "area", "audio", "b", "bdi", "bdo", "br", "button", "canvas", "cite", "code", "data",
		"datalist", "del", "dfn", "em", "embed", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "map",
		"mark", "math", "meter", "noscript", "object", "output", "progress", "q", "ruby", "s", "samp", "small", "span",
		"strong", "sub", "sup", "svg", "template", "textarea", "time", "u", "var", "video", "wbr", "text", "acronym",
		"address", "big", "dt", "ins", "strike", "tt"]
0reactions
bitwisemancommented, Aug 12, 2018

@HookyQR The main problem we have here is lack of feedback and breadth of inputs. I’ve had some people provide very useful bugs on the rc. 1.8.0 is a massive change so if you have any test inputs or can run some tests or get some more folks to give it a try.

One key change is the addition of the “inline” and “content_unformatted” options which mostly supercede the “unformatted” option.

On Sun, Aug 12, 2018, 3:49 AM HookyQR notifications@github.com wrote:

Any timeline for a 1.8.0 release. Would love to update the VS Code extension, but waiting for the -rc to drop off.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/beautify-web/js-beautify/issues/1097#issuecomment-412334386, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3kKVMsFYmS-RylfG4Ns8TFZjHYydyfks5uQAg7gaJpZM4LZUVq .

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - Rendering a hierarchy of "OPTION"s in a "SELECT" tag
I have a hierarchy type structure that I want to display inside a list. The hierarchy contains Countries, States and Cities (it is...
Read more >
HTML Indentation and Spacing - LearnHowToProgram.com
When you are writing HTML (or any other programming language), well-written code follows consistent indentation and spacing patterns.
Read more >
Consistent list indentation - CSS: Cascading Style Sheets | MDN
One of the most common style changes made to lists is a change in the indentation distance—that is, how far the list items...
Read more >
Indentation of html attributes should be the same after ... - GitHub
Create a html tag with three or more attributes. (Like in the images above); Select the whole html tag and indent it with...
Read more >
Formatting & Indenting Your HTML - Scott Granneman
Why indent your code? ↩. Let's look at some examples of coding techniques to make it clear why you should indent your HTML....
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