MCPcopy Create free account
hub / github.com/TruthHun/BookStack / handleStartTag

Function handleStartTag

static/vuejs/vue.esm.js:7531–7574  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

7529 }
7530
7531 function handleStartTag (match) {
7532 var tagName = match.tagName;
7533 var unarySlash = match.unarySlash;
7534
7535 if (expectHTML) {
7536 if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
7537 parseEndTag(lastTag);
7538 }
7539 if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
7540 parseEndTag(tagName);
7541 }
7542 }
7543
7544 var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
7545
7546 var l = match.attrs.length;
7547 var attrs = new Array(l);
7548 for (var i = 0; i < l; i++) {
7549 var args = match.attrs[i];
7550 // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
7551 if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
7552 if (args[3] === '') { delete args[3]; }
7553 if (args[4] === '') { delete args[4]; }
7554 if (args[5] === '') { delete args[5]; }
7555 }
7556 var value = args[3] || args[4] || args[5] || '';
7557 attrs[i] = {
7558 name: args[1],
7559 value: decodeAttr(
7560 value,
7561 options.shouldDecodeNewlines
7562 )
7563 };
7564 }
7565
7566 if (!unary) {
7567 stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
7568 lastTag = tagName;
7569 }
7570
7571 if (options.start) {
7572 options.start(tagName, attrs, unary, match.start, match.end);
7573 }
7574 }
7575
7576 function parseEndTag (tagName, start, end) {
7577 var pos, lowerCasedTagName;

Callers 1

parseHTMLFunction · 0.70

Calls 2

parseEndTagFunction · 0.70
decodeAttrFunction · 0.70

Tested by

no test coverage detected