fix: load the pdf.js worker with the Map upsert polyfill

This commit is contained in:
alam00000 committed 2026-08-22 16:02:34 +05:30
1 parent 8e606b652c
commit c449a85745
42 files changed
+112 -181

No files matched your search

+4 -2
View File
@@ -3765,11 +3765,12 @@ function openEditor(spec, caret) {
openPv = lockedPv;
renderLockedLines(ed, para.runs, lockedPv, para, para.box.x);
singleLine = false;
const countable = (s) => s.replace(/[\u200B\u2060\n]/g, '').length;
const wantChars = para.runs.reduce(
(n, r) => n + (r.text ? r.text.length : 0),
(n, r) => n + (r.text ? countable(r.text) : 0),
0
);
const gotChars = ed.textContent.replace(/[\u200B\u2060]/g, '').length;
const gotChars = countable(ed.textContent);
if (wantChars > 0 && gotChars < wantChars * 0.98) {
ed.textContent = '';
delete ed.dataset.locked;
@@ -3840,6 +3841,7 @@ function openEditor(spec, caret) {
pristine: !!spec.para && ed.dataset.locked === '1',
};
if (state.editing.pristine) wrap.classList.add('pristine');
else if (spec.para) renderPage();
ed.focus();
placeCaret(ed, caret?.x, caret?.y);
const refocus = () => {