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.

34 lines (33 loc) 949 B
import { isSpace as h } from "../common/utils.mjs"; const n = []; for (let r = 0; r < 256; r++) n.push(0); "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(r) { n[r.charCodeAt(0)] = 1; }); function t(r, p) { let c = r.pos; const f = r.posMax; if (r.src.charCodeAt(c) !== 92 || (c++, c >= f)) return !1; let o = r.src.charCodeAt(c); if (o === 10) { for (p || r.push("hardbreak", "br", 0), c++; c < f && (o = r.src.charCodeAt(c), !!h(o)); ) c++; return r.pos = c, !0; } let i = r.src[c]; if (o >= 55296 && o <= 56319 && c + 1 < f) { const e = r.src.charCodeAt(c + 1); e >= 56320 && e <= 57343 && (i += r.src[c + 1], c++); } const s = "\\" + i; if (!p) { const e = r.push("text_special", "", 0); o < 256 && n[o] !== 0 ? e.content = i : e.content = s, e.markup = s, e.info = "escape"; } return r.pos = c + 1, !0; } export { t as default }; //# sourceMappingURL=escape.mjs.map