UNPKG

vue-files-preview-inno

Version:

A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.

30 lines (29 loc) 976 B
import { isSpace as u } from "../common/utils.mjs"; function s(n, e, d, f) { let r = n.bMarks[e] + n.tShift[e], c = n.eMarks[e]; if (n.sCount[e] - n.blkIndent >= 4) return !1; let l = n.src.charCodeAt(r); if (l !== 35 || r >= c) return !1; let i = 1; for (l = n.src.charCodeAt(++r); l === 35 && r < c && i <= 6; ) i++, l = n.src.charCodeAt(++r); if (i > 6 || r < c && !u(l)) return !1; if (f) return !0; c = n.skipSpacesBack(c, r); const o = n.skipCharsBack(c, 35, r); o > r && u(n.src.charCodeAt(o - 1)) && (c = o), n.line = e + 1; const p = n.push("heading_open", "h" + String(i), 1); p.markup = "########".slice(0, i), p.map = [e, n.line]; const h = n.push("inline", "", 0); h.content = n.src.slice(r, c).trim(), h.map = [e, n.line], h.children = []; const k = n.push("heading_close", "h" + String(i), -1); return k.markup = "########".slice(0, i), !0; } export { s as default }; //# sourceMappingURL=heading.mjs.map