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

Function parseHTML

static/vuejs/vue.common.js:7388–7630  ·  view source on GitHub ↗
(html, options)

Source from the content-addressed store, hash-verified

7386}
7387
7388function parseHTML (html, options) {
7389 var stack = [];
7390 var expectHTML = options.expectHTML;
7391 var isUnaryTag$$1 = options.isUnaryTag || no;
7392 var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
7393 var index = 0;
7394 var last, lastTag;
7395 while (html) {
7396 last = html;
7397 // Make sure we're not in a plaintext content element like script/style
7398 if (!lastTag || !isPlainTextElement(lastTag)) {
7399 var textEnd = html.indexOf('<');
7400 if (textEnd === 0) {
7401 // Comment:
7402 if (comment.test(html)) {
7403 var commentEnd = html.indexOf('-->');
7404
7405 if (commentEnd >= 0) {
7406 advance(commentEnd + 3);
7407 continue
7408 }
7409 }
7410
7411 // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
7412 if (conditionalComment.test(html)) {
7413 var conditionalEnd = html.indexOf(']>');
7414
7415 if (conditionalEnd >= 0) {
7416 advance(conditionalEnd + 2);
7417 continue
7418 }
7419 }
7420
7421 // Doctype:
7422 var doctypeMatch = html.match(doctype);
7423 if (doctypeMatch) {
7424 advance(doctypeMatch[0].length);
7425 continue
7426 }
7427
7428 // End tag:
7429 var endTagMatch = html.match(endTag);
7430 if (endTagMatch) {
7431 var curIndex = index;
7432 advance(endTagMatch[0].length);
7433 parseEndTag(endTagMatch[1], curIndex, index);
7434 continue
7435 }
7436
7437 // Start tag:
7438 var startTagMatch = parseStartTag();
7439 if (startTagMatch) {
7440 handleStartTag(startTagMatch);
7441 continue
7442 }
7443 }
7444
7445 var text = (void 0), rest$1 = (void 0), next = (void 0);

Callers 1

parseFunction · 0.70

Calls 4

advanceFunction · 0.70
parseEndTagFunction · 0.70
parseStartTagFunction · 0.70
handleStartTagFunction · 0.70

Tested by

no test coverage detected