duncanbeevers / rails_view_annotator

Wraps the rendering of Rails partials with html comments indicating the disk location of the rendered partial
32 stars 9 forks source link

Invalid comments inserted into JavaScript partials #7

Closed hinrik closed 10 years ago

hinrik commented 12 years ago

When JavaScript partials are rendered, this gem inserts <!-- --> comments, which are invalid, and cause problems in IE7 at least.

duncanbeevers commented 12 years ago

Urk. I haven't written inline javascript in some time so this issue hasn't come up before. It seems like it could be an issue when we're rendering anything other than html partials (builder partials, javascript partials, etc...)

Any ideas on a good work-around for this?

hinrik commented 12 years ago

Maybe that solution can be improved, but it works for me.

iainbeeston commented 10 years ago

This problem also exists for json partials, although the pull request above fixes that (by not inserting comments if the format is unrecognised)

duncanbeevers commented 10 years ago

Went ahead and merged #8. Thanks for the nudge. Tagged and released 0.0.8.

iainbeeston commented 10 years ago

Ah... I was a little hasty. It turns out that the code from that pull request outputs comments and the original partial for .js and .html partials, but for any other partial it outputs nothing at all, not even the original content of the partial!

duncanbeevers commented 10 years ago

Can you throw together a PR to address this? I haven't used this gem recently, but my gut feeling is that it should be a pretty simple change.