(tag, tagName)
| 213 | } |
| 214 | |
| 215 | function parseEndTag(tag, tagName) { |
| 216 | // If no tag name is provided, clean shop |
| 217 | if (!tagName) { |
| 218 | var pos = 0; |
| 219 | } // Find the closest opened tag of the same type |
| 220 | else { |
| 221 | for (var pos = stack.length - 1; pos >= 0; pos--) { |
| 222 | if (stack[pos] == tagName) { |
| 223 | break; |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | if (pos >= 0) { |
| 229 | // Close all the open elements, up the stack |
| 230 | for (var i = stack.length - 1; i >= pos; i--) { |
| 231 | if (handler.end) { |
| 232 | handler.end(stack[i]); |
| 233 | } |
| 234 | } // Remove the open elements from the stack |
| 235 | |
| 236 | |
| 237 | stack.length = pos; |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | function makeMap(str) { |
no outgoing calls
no test coverage detected