-
Notifications
You must be signed in to change notification settings - Fork 453
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
Update html.coffee with js-beautify v1.8.1 #2215
Conversation
dd9546d
to
fe9c9af
Compare
src/languages/html.coffee
Outdated
description: "List of tags whose contents should not be reformatted" | ||
unformatted: | ||
type: 'array' | ||
default: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is breaking changes for current users using unformatted
.
Could you explain the difference between inline
, content_unformatted
, and old unformatted
option?
It sounds like: unformatted
has been:
- renamed to
inline
withinjs-beautify
, and - updated the array of tag names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, inline
is an entire new behavior. Unformatted
should generally behave the same, but inline
more accurately model correct HTML behavior. You have sample tests... But I can make sense of which ones should be failing or not...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Could we leave the existing unformatted
without changes then? Then this PR becomes a new feature (adding options) instead of a breaking change of unformatted
for those users who do actually use the default value (not recommended).
This PR would add the options:
inline
content_unformatted
Tasks:
- languages (i.e. HTML)
atom-beautify/src/languages/html.coffee
Line 67 in fe9c9af
inline:
- beautifier (i.e.g
js-beautify
)js-beautify
is currently usingtrue
which means pass all options- https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/js-beautify.coffee#L10
- Fix any broken regression tests
- I would not expect any large changes, just maybe a few little things because
js-beautify
is being updated. However, the configurations should stay the same
- I would not expect any large changes, just maybe a few little things because
- Add a new test using
inline
, demonstrating @garretwilson 's problem is resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we leave the existing
unformatted
without changes then?
No, please don't do that. That would be partially defeating the purpose of inline
, because you'll be saying not to format things like <a>
at all!! And no one wants that. We only had it not being unformatted before because it would format it as "not inline". This has been fixed.
… a breaking change of unformatted for those users who do actually use the default value …
But nobody wants the old unformatted
default values! Nobody says, "I like my inline elements the way they are; keep your hands off." And if there is that one person, they can add "unformatted"
to their settings.
But otherwise, to get inline elements to be formatted, if you leave the existing unformatted
settings everyone (the 99.997% of people who want them to be formatted) will have to add "unformatted": []
to their manual settings!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Glavin001 I agree with Garret that keeping unformatted will make inline largely ineffective. But in the interest of getting the new options added and available I'm happy to keep the existing default in this version, if that is what it takes. I understand the need to limit the risk of breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But otherwise, to get inline elements to be formatted, if you leave the existing unformatted settings everyone (the 99.997% of people who want them to be formatted) will have to add "unformatted": [] to their manual settings!!
@bitwiseman Do you also expect everyone to be using "unformatted": []
from now on? Is there no value in unformatted
anymore and going to be removed from js-beautify
later? Given the new ideal value for unformatted
is []
it sounds like we should remove the unformatted
option entirely in favour of inline
and content_unformatted
which "more accurately model correct HTML behavior".
Fortunately, unformatted
is only used by JS Beautify
beautifier: https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#unformatted
So if we really need to make a breaking change, let's do it.
If the expectation is unformatted
should no longer be used, let's not only go half way and set it to []
, let's remove it entirely and make a big note in the changelog about these new and improved options for formatting.
Thanks for submitting this PR, @bitwiseman ! 🎉 |
6e0303b
to
4a7558a
Compare
@Glavin001 Also, you requested a test showing the inline behavior is working, but it is hard to make that happen with Other than that this is ready. |
@bitwiseman can you please do the following:
It looks like JS Beautify doesn't format I'll look into the Linux builds. |
@szeck87 |
What same error? The blade.php one? |
Yes. I get the same error in blade on master. :( |
@szeck87 Ah, but it was before your release an hour ago. |
The blade.php error is definitely not from master. I'm going through the other errors now. You can actually wait to rebase from master. |
@bitwiseman looks like two failures:
|
@szeck87 The blade change: When I put |
@bitwiseman I'll take a closer look when I get home. But try running the original using atom beautify with the updated js-beautify version in your PR here. Maybe it's not running the same options as beautifier.io |
@bitwiseman except for a couple of spaces, js-beautify and beautifier.io both change the blade file in these two places: For some reason atom-beautify is putting two spaces after the |
@szeck87 Thanks! I think I got it. The blade template was expecting space not to be added to void elements - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Almost there.
@szeck87 Good to merge and publish, after fixing typos and your approval 👍 .
Thanks!! 🎉
src/languages/html.coffee
Outdated
@@ -79,7 +79,27 @@ module.exports = { | |||
] | |||
items: | |||
type: 'string' | |||
description: "List of tags (defaults to inline) that should not be reformatted" | |||
description: "(Depracated for most scenarios) List of tags that should not be reformatted at all. NOTE: Set this to [] to get improved beautifier behavior." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: Note about improved behaviour.
Do you want to mention inline
option at all?
No,
I do not think we can or should remove A note in the changelog in any case would be a good idea. |
Sorry about that 😝 . I did not think leaving I trust your judgement. 👍 |
CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
|
|||
# v0.33.2 (2018-09-09) | |||
- Added `inline` and `content_unformatted` options from `js-beautify` html settings and cleared `unformatted`. This is a breaking change, but a general improvement in the behavior to more accurately beautify html. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a link to this PR and any PRs or Issues from js-beautify
? And maybe bold breaking change
or do something to make sure users see it 🔥 . Thanks!
@szeck87 since you are more actively maintaining Atom-Beautify, would you be able to merge when ready and publish? Thank you 😃 . Thanks for contributing, @bitwiseman ! 🎉 |
@Glavin001 @szeck87 |
Merged |
I saw the bounty claim, @bitwiseman . I'm excited to see this done and will of course go in and approve the payment. I was hoping to see the final release shipped, though, just to see it in action. I guess that's still not out yet. |
No hurry.
…On Mon, Sep 17, 2018, 4:51 PM Garret Wilson ***@***.***> wrote:
I saw the bounty claim, @bitwiseman <https://github.com/bitwiseman> . I'm
excited to see this done and will of course go in and approve the payment.
I was hoping to see the final release shipped, though, just to see it in
action. I guess that's still not out yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2215 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB3kKYjh4ow1Tu5Iz0i6AEHvUSJ2REeoks5ucDWOgaJpZM4WWEyF>
.
|
Wait, I see that v0.33.1 was marked above. So was this included in the public release of atom-beautify already? |
@garretwilson no, I forgot to update the milestones after the v0.33.1 release. It will be included in the next release. |
The suspense is killing me… 😀 |
OK… I don't want to be irritating, but you know I've been waiting years for this. 😁 Today I couldn't resist any longer: "Are we there yet?" 😄 i.e. Do we have a release planned soon to include this super-important-to-me bug fix? |
@stevenzeck, after reviewing the messages, I'm not sure why this didn't go out already. @Glavin001 already gave permission above to release this. I've been waiting years for this big bug to be fixed, and I've even contributed hundreds of dollars in bounty money. At every step there seems to be something impeding this from actually going out the door. Now I don't see what the hold-up is. It's done. It's merged. Everybody has been paid. What needs to be done next to release this thing? |
@garretwilson we've been focusing on Unibeautify and only doing PR's and releases here as requested. I just released v0.33.2 which includes this. |
@stevenzeck you don't know how much I appreciate this. Good luck with your Unibeautify work. I'm eagerly looking forward to v0.33.2. |
What does this implement/fix? Explain your changes.
Adds settings from js-beautify v1.8.1
Does this close any currently open issues?
Closes #2210
Any other comments?
Unsure if this is sufficient.
Checklist
Check all those that are applicable and complete.
master
branchnpm run docs
CHANGELOG.md
under "Next" section?