UNPKG

@forbespro/lead-agent

Version:
81 lines (80 loc) 2.1 kB
import { factoryDestination as D } from "./index187.js"; import { factoryLabel as S } from "./index188.js"; import { factorySpace as s } from "./index161.js"; import { factoryTitle as g } from "./index189.js"; import { factoryWhitespace as d } from "./index190.js"; import { markdownLineEndingOrSpace as k, markdownSpace as h, markdownLineEnding as L } from "./index146.js"; import { normalizeIdentifier as w } from "./index129.js"; const O = { name: "definition", tokenize: M }, z = { partial: !0, tokenize: y }; function M(t, f, e) { const r = this; let o; return u; function u(i) { return t.enter("definition"), a(i); } function a(i) { return S.call( r, t, n, // Note: we don’t need to reset the way `markdown-rs` does. e, "definitionLabel", "definitionLabelMarker", "definitionLabelString" )(i); } function n(i) { return o = w(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)), i === 58 ? (t.enter("definitionMarker"), t.consume(i), t.exit("definitionMarker"), b) : e(i); } function b(i) { return k(i) ? d(t, l)(i) : l(i); } function l(i) { return D( t, c, // Note: we don’t need to reset the way `markdown-rs` does. e, "definitionDestination", "definitionDestinationLiteral", "definitionDestinationLiteralMarker", "definitionDestinationRaw", "definitionDestinationString" )(i); } function c(i) { return t.attempt(z, m, m)(i); } function m(i) { return h(i) ? s(t, p, "whitespace")(i) : p(i); } function p(i) { return i === null || L(i) ? (t.exit("definition"), r.parser.defined.push(o), f(i)) : e(i); } } function y(t, f, e) { return r; function r(n) { return k(n) ? d(t, o)(n) : e(n); } function o(n) { return g(t, u, e, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(n); } function u(n) { return h(n) ? s(t, a, "whitespace")(n) : a(n); } function a(n) { return n === null || L(n) ? f(n) : e(n); } } export { O as definition };