halcwb
halcwb

Reputation: 1480

Is it possible to put a hash in a coffeescript comment

I want to create a comment in coffeescript that transpiles to the following js:

//# This is a comment with an hash

The # in the comment is necessary because of a framework build script (qooxdoo) that uses the hashed comment as a directive. And of course that is a bit tricky as the # is used to demarcate a comment.

How can a put a hash (#) in a coffeescript comment such that the # is transpiled to javascript in a comment?

Upvotes: 0

Views: 65

Answers (1)

halcwb
halcwb

Reputation: 1480

Found it:

###*
# #This is a comment with a hash
###

At least within a block comment this transpiles to:

/**
 * #This is a comment with a hash
 */

Upvotes: 1

Related Questions