This commit is contained in:
Vanessa 2023-05-31 10:23:41 +08:00
parent b24224f7c4
commit 8719a5974f

View file

@ -331,8 +331,8 @@ const getHightlightCoordsByRange = (pdf: any, color: string) => {
}
}
});
const content = Lute.EscapeHTMLStr(rangeContents.textContent);
// eslint-disable-next-line no-control-regex
const content = Lute.EscapeHTMLStr(rangeContents.textContent.replace(/[\x00]|\n/g, ""));
const startPage = pdf.pdfViewer.getPageView(startIndex);
const startPageRect = startPage.canvas.getClientRects()[0];
const startViewport = startPage.viewport;