Skip to content

Commit

Permalink
Explicit root constant lookup. (See #83)
Browse files Browse the repository at this point in the history
  • Loading branch information
netzpirat committed Feb 9, 2013
1 parent 7c6d256 commit 3a6f5c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vendor/assets/javascripts/hamlcoffee.js.coffee.erb
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions vendor/assets/javascripts/hamlcoffee_amd.js.coffee.erb
Expand Up @@ -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.
Expand Down

0 comments on commit 3a6f5c9

Please sign in to comment.