MCPcopy Create free account
hub / github.com/CoderOpen/waimai / parseEndTag

Function parseEndTag

front/common/html-parser.js:215–239  ·  view source on GitHub ↗
(tag, tagName)

Source from the content-addressed store, hash-verified

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
242function makeMap(str) {

Callers 2

HTMLParserFunction · 0.85
parseStartTagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected