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

tiddy up broke html ember script #283

Closed
xqiu opened this issue Jan 18, 2013 · 12 comments
Closed

tiddy up broke html ember script #283

xqiu opened this issue Jan 18, 2013 · 12 comments

Comments

@xqiu
Copy link

xqiu commented Jan 18, 2013

Have the following in html frame,

<script type="text/x-handlebars" data-template-name="myTemplate">
<button {{action clickButton}} > MyButton1
{{view App.MyView placeholder="Input something 1 and enter"}}
</script>

Click tidy up, it's changed to wrong code:

<script type="text/x-handlebars" data-template-name="myTemplate">
< button {
{
action clickButton
}
} > MyButton1 < /button>
{{view App.MyView placeholder="Input something 1 and enter"}}
</script>

@oskarkrawczyk
Copy link
Member

js-beautify (which we use for tidying up) doesn't know what to do with those custom strings in place of normal properties, and this is the result of this.

I wouldn't even know where to start modifying all the regular expressions for js-beautify to ignore these strings.

@xqiu
Copy link
Author

xqiu commented Jan 19, 2013

Update the original post to display correctly in the github. The problem is <script> type is not a text/javascript type, so they should not be formatted using js-beautify.

@xqiu
Copy link
Author

xqiu commented Jan 19, 2013

I don't have permission to reopen the issue. Hope you can receive the comments.

@oskarkrawczyk
Copy link
Member

js-beautify supports JS, HTML and CSS.

@zalun
Copy link
Member

zalun commented Jan 19, 2013

We will not support it, however we might add support for the language in the future (not near thought - in beta)

@abrkn
Copy link

abrkn commented Feb 25, 2013

Having same problem, tidyup is formatting non-javascript script blocks:

<script type="text/html" id="spot-template">...</div>.

maybe you can look at the script type and leave it be if not js.

@oskarkrawczyk
Copy link
Member

Provide a test-case fiddle please.

@ses4j
Copy link

ses4j commented Aug 6, 2014

jsbeautify has recently corrected this, can jsFiddle update their jsbeautify library?

beautifier/js-beautify#385 and beautifier/js-beautify#453

@zalun
Copy link
Member

zalun commented Aug 6, 2014

Will do after we will deal with this outage

@davhdavh
Copy link

Still outage?

@oskarkrawczyk
Copy link
Member

Nope

@davhdavh
Copy link

So fix on the way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants