MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / inlineTokens

Method inlineTokens

web/marked.min.js:1384–1504  ·  view source on GitHub ↗
(e, t = [])

Source from the content-addressed store, hash-verified

1382 return (this.inlineQueue.push({ src: e, tokens: t }), t);
1383 }
1384 inlineTokens(e, t = []) {
1385 let n = e,
1386 s = null;
1387 if (this.tokens.links) {
1388 let o = Object.keys(this.tokens.links);
1389 if (o.length > 0)
1390 for (
1391 ;
1392 (s = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null;
1393 )
1394 o.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) &&
1395 (n =
1396 n.slice(0, s.index) +
1397 "[" +
1398 "a".repeat(s[0].length - 2) +
1399 "]" +
1400 n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1401 }
1402 for (
1403 ;
1404 (s = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;
1405 )
1406 n =
1407 n.slice(0, s.index) +
1408 "++" +
1409 n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1410 for (; (s = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; )
1411 n =
1412 n.slice(0, s.index) +
1413 "[" +
1414 "a".repeat(s[0].length - 2) +
1415 "]" +
1416 n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1417 let i = !1,
1418 r = "";
1419 for (; e; ) {
1420 (i || (r = ""), (i = !1));
1421 let o;
1422 if (
1423 this.options.extensions?.inline?.some((c) =>
1424 (o = c.call({ lexer: this }, e, t))
1425 ? ((e = e.substring(o.raw.length)), t.push(o), !0)
1426 : !1,
1427 )
1428 )
1429 continue;
1430 if ((o = this.tokenizer.escape(e))) {
1431 ((e = e.substring(o.raw.length)), t.push(o));
1432 continue;
1433 }
1434 if ((o = this.tokenizer.tag(e))) {
1435 ((e = e.substring(o.raw.length)), t.push(o));
1436 continue;
1437 }
1438 if ((o = this.tokenizer.link(e))) {
1439 ((e = e.substring(o.raw.length)), t.push(o));
1440 continue;
1441 }

Callers 5

lexMethod · 0.95
meFunction · 0.80
emStrongMethod · 0.80
delMethod · 0.80
lexInlineMethod · 0.80

Calls 11

escapeMethod · 0.80
tagMethod · 0.80
linkMethod · 0.80
reflinkMethod · 0.80
emStrongMethod · 0.80
codespanMethod · 0.80
brMethod · 0.80
delMethod · 0.80
autolinkMethod · 0.80
urlMethod · 0.80
inlineTextMethod · 0.80

Tested by

no test coverage detected