js-beautify: `force-expand-multiline` doesn't work as expected

Description

force-expand-multiline doesn’t work as expected.

Input

The code looked like this before beautification:

<template>
  <div
    class="test"
    @click="test"
  >
    <input
      ref="test"
      v-if="test"
    >
      <div>
        <span>test</span>
      </div>
      </div>
</template>

Expected Output

The code should have looked like this after beautification:

<template>
  <div
    class="test"
    @click="test"
  >
    <input
      ref="test"
      v-if="test"
    >
    <div>
      <span>test</span>
    </div>
  </div>
</template>

Actual Output

The code actually looked like this after beautification:

> html-beautify --version
1.6.12
> html-beautify -f test.html -A "force-expand-multiline"
<template>
  <div
    class="test"
    @click="test"
  >
    <input
      ref="test"
      v-if="test"
    >
      <div>
        <span>test</span>
      </div>
      </div>
</template>%

Steps to Reproduce

Environment

OS: macOS 10.12.4

Settings

> html-beautify -f test.html -A "force-expand-multiline"

Related https://github.com/octref/vetur/issues/99

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 14
  • Comments: 17 (6 by maintainers)

Most upvoted comments

fixed in 1.7.6

What’s the status on this one? I’d really love to see this fixed.

it still not working on vscode@1.22.2 too

@GearoidCollins it still not working on vscode@1.21.1

People still getting this issue? I seem to be getting it with "html.format.wrapAttributes": "force-expand-multiline" on vscode@1.20.1

@bitwiseman Right, I fixed that. Sorry for the confusion.