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

Function parseStartTag

front/common/html-parser.js:178–213  ·  view source on GitHub ↗
(tag, tagName, rest, unary)

Source from the content-addressed store, hash-verified

176 parseEndTag();
177
178 function parseStartTag(tag, tagName, rest, unary) {
179 tagName = tagName.toLowerCase();
180
181 if (block[tagName]) {
182 while (stack.last() && inline[stack.last()]) {
183 parseEndTag('', stack.last());
184 }
185 }
186
187 if (closeSelf[tagName] && stack.last() == tagName) {
188 parseEndTag('', tagName);
189 }
190
191 unary = empty[tagName] || !!unary;
192
193 if (!unary) {
194 stack.push(tagName);
195 }
196
197 if (handler.start) {
198 var attrs = [];
199 rest.replace(attr, function (match, name) {
200 var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : '';
201 attrs.push({
202 name: name,
203 value: value,
204 escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // "
205
206 });
207 });
208
209 if (handler.start) {
210 handler.start(tagName, attrs, unary);
211 }
212 }
213 }
214
215 function parseEndTag(tag, tagName) {
216 // If no tag name is provided, clean shop

Callers

nothing calls this directly

Calls 1

parseEndTagFunction · 0.85

Tested by

no test coverage detected