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

Compiling with TextMate produces incorrect result #6

Closed
jacob-carlborg opened this issue Sep 13, 2010 · 4 comments
Closed

Compiling with TextMate produces incorrect result #6

jacob-carlborg opened this issue Sep 13, 2010 · 4 comments

Comments

@jacob-carlborg
Copy link

Compiling a coffee script file with TextMate (Compile and Display JS) gives a different result compared to compiling with coffee on the command line. This happens if I insert raw javascript with backticks and the javascript code is invalid. For example:

<% if @autoload %>

The above will be compiled into an empty expression ending with a semicolon.

@jashkenas
Copy link
Owner

Huh? did you mean:

`if @autoload`

That compiles into this for me, using Compile and Display JS:

  if @autoload ;

@jacob-carlborg
Copy link
Author

No I meant <% if @autoload %> and I see now that the backticks are not displayed. I'm inserting Ruby on Rails template code and compiling the CoffeeScript file to a Ruby on Rails JavaScript template file (.js.erb). This is working fine using the command line but not in TextMate. I think it's the <% and %> that is causing the problem.

@jashkenas
Copy link
Owner

Gotcha. The command was using TextMate's "Display as HTML" ability, and wasn't escaping angle brackets in the output. Here's a patch that should fix your problem:

http://github.com/jashkenas/coffee-script-tmbundle/commit/3cc7839e9d03e7d02790bd2e004bd52151ddf3f1

@jacob-carlborg
Copy link
Author

Thanks.

This issue was closed.
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