Permalink
Browse files

attempt another backreference workaround fix

  • Loading branch information...
1 parent 1cfbac6 commit cc649875bf6526f9b37d118ab51edd6b08817876 @marcuswestin committed Mar 22, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 compiler.js
View
@@ -60,9 +60,10 @@ function compileHTMLFile(filePath, opts) {
var js = compileFile(match[1].toString(), opts)
var BACKREFERENCE_WORKAROUND = '____________backreference_workaround________'
- js = js.replace(/\$\&/g, BACKREFERENCE_WORKAROUND)
+ var BACKREFERENCE_WORKAROUND_REGEX = new RegExp(BACKREFERENCE_WORKAROUND, 'g')
+ js = js.replace(\$\&/g, BACKREFERENCE_WORKAROUND)
html = html.replace(match[0], '<script>'+js+'</script>')
- html = html.replace(BACKREFERENCE_WORKAROUND, '\$\&')
+ html = html.replace(BACKREFERENCE_WORKAROUND_REGEX, '\$\&')
}
return html
}

0 comments on commit cc64987

Please sign in to comment.