Atom-beautify: HTML beautifying not working

Created on 2 Feb 2017  路  5Comments  路  Source: Glavin001/atom-beautify

Description

The results of beautification are not what I expect.

Input Before Beautification

This is what the code looked like before:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <ul><li><a href="#">X</a></li></ul>
</body>

</html>

Expected Output

The beautified code should have looked like this:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <ul>
        <li><a href="#">X</a></li>
    </ul>
</body>

</html>

Actual Output

The beautified code actually looked like this:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible"
            content="ie=edge">
            <title>Document</title>
</head>

<body>
    <ul>
        <li><a href="#">X</a></li>
    </ul>
</body>

</html>

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Note: It doesn't matter if wrap_attributes is set to force or auto

Debug

Here is a link to the debug.md Gist: https://gist.github.com/nivv/737386623d093b42df615da6ad401037

Checklist

I have:

  • [x] Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [X] Reloaded (or restarted) Atom to ensure it is not a caching issue
  • [X] Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [X] Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • [X] Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
third-party-bug

All 5 comments

Seems related to https://github.com/beautify-web/js-beautify/issues/1103. Maybe we can close this one

Agreed, closing.

This has been resolved by the 3rd party. Any chance of publishing with correct reference to js-beautify?

Can we get this updated as @larsandreasness says? Seems silly to not have the latest fixes from js- beautify

Edit: I reinstalled the package and that seems to fix it.

Reinstalling atom-beautify triggers a fresh install of all of the dependencies, and is the recommended solution 馃憤 .

Feel free to submit a Pull Request to update the version numbers in the package.json, however it would be a tedious process to try and stay up to date and publish a new release for every single dependency in the package.json 馃槈 .

Was this page helpful?
0 / 5 - 0 ratings