Permalink
Browse files

Explicit root constant lookup. (See #83)

  • Loading branch information...
1 parent 7c6d256 commit 3a6f5c98713804b85f4fcbbc739ec8dd504eab90 @netzpirat netzpirat committed Feb 9, 2013
View
4 vendor/assets/javascripts/hamlcoffee.js.coffee.erb
@@ -74,9 +74,9 @@ class window.HAML
# @return [String] the preserved text
#
@findAndPreserve: (text) ->
- tags = '<%= HamlCoffeeAssets.config.preserveTags %>'.split(',').join('|')
+ tags = '<%= ::HamlCoffeeAssets.config.preserveTags %>'.split(',').join('|')
text = text.replace ///<(#{ tags })>([^]*?)<\/\1>///g, (str, tag, content) ->
- "<#{ tag }>#{ <%= HamlCoffeeAssets.config.customPreserve %>(content) }</#{ tag }>"
+ "<#{ tag }>#{ <%= ::HamlCoffeeAssets.config.customPreserve %>(content) }</#{ tag }>"
# The surround helper surrounds the function output
# with the start and end string without whitespace in between.
View
4 vendor/assets/javascripts/hamlcoffee_amd.js.coffee.erb
@@ -47,9 +47,9 @@ define ->
# @return [String] the preserved text
#
findAndPreserve: (text) ->
- tags = '<%= HamlCoffeeAssets.config.preserveTags %>'.split(',').join('|')
+ tags = '<%= ::HamlCoffeeAssets.config.preserveTags %>'.split(',').join('|')
text = text.replace ///<(#{ tags })>([^]*?)<\/\1>/// g, (str, tag, content) ->
- "<#{ tag }>#{ <%= HamlCoffeeAssets.config.customPreserve %>(content) }</#{ tag }>"
+ "<#{ tag }>#{ <%= ::HamlCoffeeAssets.config.customPreserve %>(content) }</#{ tag }>"
# The surround helper surrounds the function output
# with the start and end string without whitespace in between.

0 comments on commit 3a6f5c9

Please sign in to comment.