mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-09 09:04:18 +01:00
fix: load the pdf.js worker with the Map upsert polyfill
This commit is contained in:
1 parent
8e606b652c
commit
c449a85745
42 files changed
+112
-181
No files matched your search
@@ -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 = () => {
|
||||
|
||||
Reference in new issue
Block a user