(html, wrapTag)
| 132 | var styleRegexString = '(' + styleMatch.join('|') + ')'; |
| 133 | |
| 134 | function wrapNested(html, wrapTag) { |
| 135 | var depth = 0; |
| 136 | var lastIndex = 0; |
| 137 | var match; |
| 138 | var tagRegex = /<[^>]*>/ig; |
| 139 | while(match = tagRegex.exec(html)){ |
| 140 | lastIndex = match.index; |
| 141 | if(match[0].substr(1, 1) === '/'){ |
| 142 | if(depth === 0) break; |
| 143 | else depth--; |
| 144 | }else depth++; |
| 145 | } |
| 146 | return wrapTag + |
| 147 | html.substring(0, lastIndex) + |
| 148 | // get the start tags reversed - this is safe as we construct the strings with no content except the tags |
| 149 | angular.element(wrapTag)[0].outerHTML.substring(wrapTag.length) + |
| 150 | html.substring(lastIndex); |
| 151 | } |
| 152 | |
| 153 | function transformLegacyStyles(html){ |
| 154 | if(!html || !angular.isString(html) || html.length <= 0) return html; |
no outgoing calls
no test coverage detected
searching dependent graphs…