Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird formatting for HTML5 <tr> #882

Closed
garretwilson opened this issue Feb 22, 2016 · 4 comments
Closed

weird formatting for HTML5 <tr> #882

garretwilson opened this issue Feb 22, 2016 · 4 comments

Comments

@garretwilson
Copy link

I can't figure out what js-beautify is thinking. Using atom-beautify, I have the following .jsbeautifyrc settings:

{
    "eol": "\r\n",
    "indent_with_tabs": true,
    "preserve_newlines": false,
    "end_with_newline": true,
    "wrap_line_length": 0,
    "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", "script", "select", "small", "span", "strong", "sub", "sup", "svg", "template", "textarea", "time", "u", "var", "video", "wbr",
        "address", /*"dt",*/ "h1", "h2", "h3", "h4", "h5", "h6", "pre",
        "acronym", "big", "font", "small", "strike", "tt"
    ]
}

I have this source code:

                <tr><th><h3>Name</h3></th><td class="full-width"></td></tr>

js-beautify gives me this:

                <tr>
                    <th>
                        <h3>Name</h3></th>
                    <td class="full-width"></td>
                </tr>

What's with the hanging </th>?

@bitwiseman
Copy link
Member

I have no idea. 😄
If you add a newline before the </th> manually, it looks like it remains. So, at least it respects that.

@garretwilson
Copy link
Author

...but the whole point of js-beautify as you know is not to do things manually... 😛 hehe

@bitwiseman
Copy link
Member

Sure, but until we reach that promised land... 😄
And besides, the fact that the newline is preserved might indicate where the issue is. Might be related to #841 (or at least in that ballpark).

@garretwilson
Copy link
Author

Yeah, I was going to mention #841... 😮

@bitwiseman bitwiseman added this to the v1.7.6 milestone Jun 30, 2018
bitwiseman added a commit to bitwiseman/js-beautify that referenced this issue Jun 30, 2018
@bitwiseman bitwiseman modified the milestones: v1.8.0-rc2, 1.8.0 Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants