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

Function parse

static/vuejs/vue.common.js:7697–7926  ·  view source on GitHub ↗

* Convert HTML string to AST.

(
  template,
  options
)

Source from the content-addressed store, hash-verified

7695 * Convert HTML string to AST.
7696 */
7697function parse (
7698 template,
7699 options
7700) {
7701 warn$2 = options.warn || baseWarn;
7702 platformGetTagNamespace = options.getTagNamespace || no;
7703 platformMustUseProp = options.mustUseProp || no;
7704 platformIsPreTag = options.isPreTag || no;
7705 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
7706 transforms = pluckModuleFunction(options.modules, 'transformNode');
7707 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
7708 delimiters = options.delimiters;
7709
7710 var stack = [];
7711 var preserveWhitespace = options.preserveWhitespace !== false;
7712 var root;
7713 var currentParent;
7714 var inVPre = false;
7715 var inPre = false;
7716 var warned = false;
7717
7718 function warnOnce (msg) {
7719 if (!warned) {
7720 warned = true;
7721 warn$2(msg);
7722 }
7723 }
7724
7725 function endPre (element) {
7726 // check pre state
7727 if (element.pre) {
7728 inVPre = false;
7729 }
7730 if (platformIsPreTag(element.tag)) {
7731 inPre = false;
7732 }
7733 }
7734
7735 parseHTML(template, {
7736 warn: warn$2,
7737 expectHTML: options.expectHTML,
7738 isUnaryTag: options.isUnaryTag,
7739 canBeLeftOpenTag: options.canBeLeftOpenTag,
7740 shouldDecodeNewlines: options.shouldDecodeNewlines,
7741 start: function start (tag, attrs, unary) {
7742 // check namespace.
7743 // inherit parent ns if there is one
7744 var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
7745
7746 // handle IE svg bug
7747 /* istanbul ignore if */
7748 if (isIE && ns === 'svg') {
7749 attrs = guardIESVGBug(attrs);
7750 }
7751
7752 var element = {
7753 type: 1,
7754 tag: tag,

Callers 1

baseCompileFunction · 0.70

Calls 15

pluckModuleFunctionFunction · 0.70
parseHTMLFunction · 0.70
guardIESVGBugFunction · 0.70
makeAttrsMapFunction · 0.70
isForbiddenTagFunction · 0.70
isServerRenderingFunction · 0.70
processPreFunction · 0.70
processRawAttrsFunction · 0.70
processForFunction · 0.70
processIfFunction · 0.70
processOnceFunction · 0.70
processKeyFunction · 0.70

Tested by

no test coverage detected