vue-files-preview-inno
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
46 lines (45 loc) • 999 B
JavaScript
import { unescapeAll as u } from "../common/utils.mjs";
function c(o, n, t) {
let r, e = n;
const i = {
ok: !1,
pos: 0,
str: ""
};
if (o.charCodeAt(e) === 60) {
for (e++; e < t; ) {
if (r = o.charCodeAt(e), r === 10 || r === 60)
return i;
if (r === 62)
return i.pos = e + 1, i.str = u(o.slice(n + 1, e)), i.ok = !0, i;
if (r === 92 && e + 1 < t) {
e += 2;
continue;
}
e++;
}
return i;
}
let f = 0;
for (; e < t && (r = o.charCodeAt(e), !(r === 32 || r < 32 || r === 127)); ) {
if (r === 92 && e + 1 < t) {
if (o.charCodeAt(e + 1) === 32)
break;
e += 2;
continue;
}
if (r === 40 && (f++, f > 32))
return i;
if (r === 41) {
if (f === 0)
break;
f--;
}
e++;
}
return n === e || f !== 0 || (i.str = u(o.slice(n, e)), i.pos = e, i.ok = !0), i;
}
export {
c as default
};
//# sourceMappingURL=parse_link_destination.mjs.map