               match.replace /\[|\]/g, '.'
 
           trimmedMatch = trimmedMatch.replace attrVal, escapeBraces newAttrVal
-          """#{trimmedMatch} data-ng-attr-#{attrName}="#{escapeCurlyBraces attrVal}">"""
+          """#{trimmedMatch} data-ng-attr-#{attrName}="#{htmlEscapeCurlyBraces attrVal}">"""
       )
 
 

        helpers.logVerbose 'match 7', attrName: attrName, attrVal: attrVal
        updated = true
        hrefStr = """href="{{urlPath}}?action=#{encodeURIComponent attrVal}" """
        anchorStr = escapeBraces """<a #{hrefStr} data-ng-#{escapeCurlyBraces hrefStr}"""

        index = interpolated.indexOf match
        beforeStr = interpolated.substr 0, index

selfClosingTags = 'area, base, br, col, command, embed, hr, img, input,
  keygen, link, meta, param, source, track, wbr'.split /,\s*/

htmlEscapeCurlyBraces = (str) ->
  str
    .replace(/\{/g, '&#123;')
    .replace(/\}/g, '&#125;')
