MCPcopy
hub / github.com/fanmingming/live / parse

Function parse

m3u8/vue.js:9586–9907  ·  view source on GitHub ↗

* Convert HTML string to AST.

(
    template,
    options
  )

Source from the content-addressed store, hash-verified

9584 * Convert HTML string to AST.
9585 */
9586 function parse (
9587 template,
9588 options
9589 ) {
9590 warn$2 = options.warn || baseWarn;
9591
9592 platformIsPreTag = options.isPreTag || no;
9593 platformMustUseProp = options.mustUseProp || no;
9594 platformGetTagNamespace = options.getTagNamespace || no;
9595 var isReservedTag = options.isReservedTag || no;
9596 maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
9597
9598 transforms = pluckModuleFunction(options.modules, 'transformNode');
9599 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
9600 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
9601
9602 delimiters = options.delimiters;
9603
9604 var stack = [];
9605 var preserveWhitespace = options.preserveWhitespace !== false;
9606 var whitespaceOption = options.whitespace;
9607 var root;
9608 var currentParent;
9609 var inVPre = false;
9610 var inPre = false;
9611 var warned = false;
9612
9613 function warnOnce (msg, range) {
9614 if (!warned) {
9615 warned = true;
9616 warn$2(msg, range);
9617 }
9618 }
9619
9620 function closeElement (element) {
9621 trimEndingWhitespace(element);
9622 if (!inVPre && !element.processed) {
9623 element = processElement(element, options);
9624 }
9625 // tree management
9626 if (!stack.length && element !== root) {
9627 // allow root elements with v-if, v-else-if and v-else
9628 if (root.if && (element.elseif || element.else)) {
9629 {
9630 checkRootConstraints(element);
9631 }
9632 addIfCondition(root, {
9633 exp: element.elseif,
9634 block: element
9635 });
9636 } else {
9637 warnOnce(
9638 "Component template should contain exactly one root element. " +
9639 "If you are using v-if on multiple elements, " +
9640 "use v-else-if to chain them instead.",
9641 { start: element.start }
9642 );
9643 }

Callers 1

vue.jsFile · 0.85

Calls 15

isReservedTagFunction · 0.85
pluckModuleFunctionFunction · 0.85
parseHTMLFunction · 0.85
guardIESVGBugFunction · 0.85
createASTElementFunction · 0.85
isForbiddenTagFunction · 0.85
isServerRenderingFunction · 0.85
processPreFunction · 0.85
processRawAttrsFunction · 0.85
processForFunction · 0.85
processIfFunction · 0.85
processOnceFunction · 0.85

Tested by

no test coverage detected