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

Function handleStartTag

static/vuejs/vue.js:7527–7570  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

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

Callers 1

parseHTMLFunction · 0.70

Calls 2

parseEndTagFunction · 0.70
decodeAttrFunction · 0.70

Tested by

no test coverage detected