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

Add Angularjs+Template support #179

Closed
artworkad opened this issue Jan 7, 2015 · 5 comments
Closed

Add Angularjs+Template support #179

artworkad opened this issue Jan 7, 2015 · 5 comments

Comments

@artworkad
Copy link

For angularjs template code inside html

<% styles.forEach( function ( file ) { %>
    <link rel="stylesheet" type="text/css" href="<%= file %>" />
<% }); %>

beautifying is not working. It comes out like this:

<% styles.forEach( function ( file ) { %>
    <link rel="stylesheet" type="text/css" href="<%= file %>" />
    <% }); %>

        <!-- compiled JavaScript -->
        <% scripts.forEach( function ( file ) { %>
            <script type="text/javascript" src="<%= file %>"></script>
            <% }); %> 

Would appreciate a fix for this problem.

@Glavin001 Glavin001 self-assigned this Jan 7, 2015
@Glavin001 Glavin001 added this to the v1.0.0 milestone Jan 7, 2015
@Glavin001
Copy link
Owner

js-beautify handles HTML support for Atom Beautify. I'd recommend forwarding this issue over to them at https://github.com/beautify-web/js-beautify
Thanks.

@prettydiff
Copy link
Collaborator

This is the same syntax used with Embedded JS, ERB, Mustache, and so forth. I added support for this with: prettydiff/prettydiff#59

@Glavin001
Copy link
Owner

Excellent, @prettydiff! Then this should be coming soon with #282 release.

@Glavin001 Glavin001 modified the milestones: v1.0.0, v1.1.0 May 1, 2015
@Glavin001
Copy link
Owner

When v0.25.0 is released you can beautify Angular Template code using EJS (Embedded JavaScript) language, which uses the Pretty Diff beautifier. In Atom Beautify, EJS language is detected with the JavaScript Template grammar. You can force Atom to treat your file as JavaScript Template grammar by clicking your file's current grammar in the bottom status bar and changing it to JavaScript Template.

File's current grammar is HTML:

image

Then select grammar JavaScript Template:

image

Let me know if you have any problems.

@Glavin001 Glavin001 modified the milestones: v1.0.0, v1.1.0 May 3, 2015
@Glavin001
Copy link
Owner

Published to v0.25.0

This is a very big release with lots of internal changes and (hopefully) no breaking changes. Please let me know if you are experiencing any unusual behaviour / breaking changes after updating. Thank you.

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

3 participants