           "#{anchorStr}>\n#{close.before.replace attrName, escapeBasicAttribute attrName}\n</a>\n#{close.after}"
       )
 
-      # attr="{{intrerpolation}}"
+      # attr="{{interpolation}}"
       # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
       .replace(/<[^>]*?([\w\-]+)\s*=\s*"([^">_]*?\{\{[^">]+\}\}[^">_]*?)"[\s\S]*?>/g, (match, attrName, attrVal) ->

          escapeDoubleBraces match
      )

  # Unescape and output
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  interpolated = unescapeTripleBraces interpolated
  interpolated = unescapeReplacements interpolated
  interpolated = unescapeBasicAttributes interpolated
  # interpolated = convertNgToDataNg interpolated
  interpolated = convertDataNgToNg interpolated
  interpolated = unescapeDoubleBraces unescapeDoubleBraces interpolated
  beautified = beautify interpolated

  if argv.file and not argv['no-write']
    fs.writeFileSync 'template-output/output.html', beautified

  beautified


compile.setHelpers = (handlebars) ->
  require('./handlebars-helpers') handlebars

        escapeDoubleBraces """#{openTag}{{translate '#{ cleanedContents.trim() }' '#{cleanedValues}'}}#{closeTag}"""


      # ng-show, ng-hide, bo-show, bo-hide
      # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      .replace(/\s((?:ng|bo)-show|(?:ng|bo)-hide)\s*=\s*"([^"]+)"/g, (match, showOrHide, expression) ->
        helpers.logVerbose 'match 6'

        updated = true
        hbsTagType = if showOrHide.indexOf('-show') isnt -1 then 'hbsShow' else 'hbsHide'
        match = match.replace ' ' + showOrHide, " data-#{showOrHide}"
        "#{match} {{#{hbsTagType} \"#{expression}\"}}"
      )

      # ng-bind, ng-bind-html, bo-bind, bo-html
      # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      .replace /<[^>]*\s((?:ng|bo)-bind|ng-bind-html|bo-html)\s*=\s*"([^"]+)"[^>]*>[^<]*(<.*?>)/g, (match, type, expression, closeTag) ->
        helpers.logVerbose 'match 7'
        updated = true
        str = match.replace type, "data-#{type}"
        expressionTag = if type is 'ng-bind-html' then escapeTripleBraces "{{{#{expression}}}}" else escapeDoubleBraces "{{#{expression}}}"
        str = str.replace closeTag, expressionTag + closeTag


