Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Leixcal][Hashtag] Fix prevSibling not getting updated after replacement of match as followup #6053 #6067

Merged
merged 5 commits into from
May 9, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/lexical-text/src/registerLexicalTextEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function registerLexicalTextEntity<T extends TextNode>(
return;
}

const prevSibling = node.getPreviousSibling();
let prevSibling = node.getPreviousSibling();
let text = node.getTextContent();
let currentNode = node;
let match;
Expand Down Expand Up @@ -100,7 +100,6 @@ export function registerLexicalTextEntity<T extends TextNode>(
}
}

// eslint-disable-next-line no-constant-condition
let prevMatchLengthToSkip = 0;
// eslint-disable-next-line no-constant-condition
while (true) {
Expand Down Expand Up @@ -128,12 +127,6 @@ export function registerLexicalTextEntity<T extends TextNode>(
return;
}
}
} else {
const nextMatch = getMatch(nextText);

if (nextMatch !== null && nextMatch.start === 0) {
return;
}
}

if (match === null) {
Expand Down Expand Up @@ -165,6 +158,7 @@ export function registerLexicalTextEntity<T extends TextNode>(
if (currentNode == null) {
return;
}
prevSibling = replacementNode;
}
};

Expand Down
Loading