MCPcopy
hub / github.com/icindy/wxParse / parseEndTag

Function parseEndTag

wxParse/htmlparser.js:160–181  ·  view source on GitHub ↗
(tag, tagName)

Source from the content-addressed store, hash-verified

158 }
159
160 function parseEndTag(tag, tagName) {
161 // If no tag name is provided, clean shop
162 if (!tagName)
163 var pos = 0;
164
165 // Find the closest opened tag of the same type
166 else {
167 tagName = tagName.toLowerCase();
168 for (var pos = stack.length - 1; pos >= 0; pos--)
169 if (stack[pos] == tagName)
170 break;
171 }
172 if (pos >= 0) {
173 // Close all the open elements, up the stack
174 for (var i = stack.length - 1; i >= pos; i--)
175 if (handler.end)
176 handler.end(stack[i]);
177
178 // Remove the open elements from the stack
179 stack.length = pos;
180 }
181 }
182};
183
184

Callers 2

HTMLParserFunction · 0.85
parseStartTagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected