fix highlighting on elements on page end #74
|
|
@ -10,8 +10,8 @@ import type {
|
||||||
OnGetTextSuccess,
|
OnGetTextSuccess,
|
||||||
} from "node_modules/react-pdf/dist/esm/shared/types";
|
} from "node_modules/react-pdf/dist/esm/shared/types";
|
||||||
import { socket } from "../socket";
|
import { socket } from "../socket";
|
||||||
import { highlightPattern } from "../util/highlighting";
|
|
||||||
import { API_HOST } from "../util/api";
|
import { API_HOST } from "../util/api";
|
||||||
|
import { highlightPattern } from "../util/highlighting";
|
||||||
|
|
||||||
interface PDFViewerProps {
|
interface PDFViewerProps {
|
||||||
pitchBookId: string;
|
pitchBookId: string;
|
||||||
|
|
@ -111,7 +111,8 @@ export default function PDFViewer({
|
||||||
) {
|
) {
|
||||||
for (
|
for (
|
||||||
let k = textItems[i].i;
|
let k = textItems[i].i;
|
||||||
k < textItems[i + s.split(" ").length].i;
|
k < textItems[i + s.split(" ").length]?.i ||
|
||||||
|
k < textItems[i + s.split(" ").length - 1]?.i;
|
||||||
k++
|
k++
|
||||||
) {
|
) {
|
||||||
tmpPos.push(textContent[k].posKey);
|
tmpPos.push(textContent[k].posKey);
|
||||||
|
|
@ -129,7 +130,8 @@ export default function PDFViewer({
|
||||||
) {
|
) {
|
||||||
for (
|
for (
|
||||||
let k = textItems[i].i;
|
let k = textItems[i].i;
|
||||||
k < textItems[i + focusHighlight.text.split(" ").length].i;
|
k < textItems[i + focusHighlight.text.split(" ").length]?.i ||
|
||||||
|
k < textItems[i + focusHighlight.text.split(" ").length - 1]?.i;
|
||||||
k++
|
k++
|
||||||
) {
|
) {
|
||||||
tmpPosHighlight.push(textContent[k].posKey);
|
tmpPosHighlight.push(textContent[k].posKey);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue