vue-files-preview-inno
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
25 lines (24 loc) • 745 B
JavaScript
import { isSpace as d } from "../common/utils.mjs";
function h(n, p) {
let r = n.pos;
if (n.src.charCodeAt(r) !== 10)
return !1;
const e = n.pending.length - 1, o = n.posMax;
if (!p)
if (e >= 0 && n.pending.charCodeAt(e) === 32)
if (e >= 1 && n.pending.charCodeAt(e - 1) === 32) {
let i = e - 1;
for (; i >= 1 && n.pending.charCodeAt(i - 1) === 32; ) i--;
n.pending = n.pending.slice(0, i), n.push("hardbreak", "br", 0);
} else
n.pending = n.pending.slice(0, -1), n.push("softbreak", "br", 0);
else
n.push("softbreak", "br", 0);
for (r++; r < o && d(n.src.charCodeAt(r)); )
r++;
return n.pos = r, !0;
}
export {
h as default
};
//# sourceMappingURL=newline.mjs.map