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

Beautify on save duplicates markup in live preview #14

Closed
misterManSam opened this issue Oct 7, 2015 · 7 comments
Closed

Beautify on save duplicates markup in live preview #14

misterManSam opened this issue Oct 7, 2015 · 7 comments

Comments

@misterManSam
Copy link

When "Beautify on save" is enabled, the markup is displayed twice in the live preview when saved.

To recreate:

  1. Enable "Beautify on save"
  2. Markup a page
  3. Make some sloppy indentation
  4. Open a live preview
  5. Save the document

Brackets

Release 1.4 build 1.4.0-16380 (release 273804eb3)
build timestamp: Mon Jul 27 2015 07:23:52 GMT+0100

Screencast:
Youtube link

Screenshot:
Example

@misterManSam misterManSam changed the title Beautify on save duplicates markup in live display Beautify on save duplicates markup in live preview Oct 7, 2015
@David-Else
Copy link

This happens for me too! It also happens when I press ctrl+alt+b. It does not always happen, but very often. I can't seem to pin down exactly when.

I am running Windows 7 and the last official Brackets Release 1.4 build 1.4.0-16380 (release 273804eb3) and Chrome Version 45.0.2454.101 m.

Really hope this can get fixed as it's making this amazing extension unusable at the moment.

@Hirse Hirse added the bug label Oct 14, 2015
@Hirse
Copy link
Owner

Hirse commented Oct 14, 2015

For the Beautify-On-Save functionality I have used a similar approach as MiguelCastillo's Brackets-wsSanitizer, but that extension does not seem to have this issue.
I am going to see where the difference lie and try to fix this.

@David-Else
Copy link

Great news, good luck!

@Hirse
Copy link
Owner

Hirse commented Nov 1, 2015

After searching through my code for a long time and not finding anything, I decided to check if this had been reported with Brackets itself.
It turns out it has:
Apparently this happens when you replace the <html>-tag in the document: adobe/brackets#10634
Unfortunately, there is no fix for it yet and one possible PR is somewhat stuck in the validation phase: adobe/brackets#10653

I will see if I can find a workaround, but in the worst case, I would just disable Beautify-On-Save on html files when live preview is enabled.

@Hirse
Copy link
Owner

Hirse commented Nov 1, 2015

I think I have found a work-around: If the LivePreview is active, only beautify content inside <html>.
Please install the extension from URL and check if that works for you.

@Denisov21
Copy link

Denisov21 commented Jun 16, 2016

Yes, I tried it works perfectly @Hirse! With version 2.2

@brackets-beautify-updater

Great

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

5 participants