1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Lexical: Added dark mode styles, fixed autolink range

This commit is contained in:
Dan Brown
2024-12-14 15:17:33 +00:00
parent 97b201f61f
commit a71aa241ad
3 changed files with 33 additions and 20 deletions

View File

@@ -24,7 +24,7 @@ describe('Auto-link service tests', () => {
pNode.append(text);
$getRoot().append(pNode);
text.select(35, 35);
text.select(34, 34);
});
editor.commitUpdates();
@@ -62,7 +62,7 @@ describe('Auto-link service tests', () => {
pNode.append(text);
$getRoot().append(pNode);
text.select(35, 35);
text.select(34, 34);
});
editor.commitUpdates();

View File

@@ -27,7 +27,7 @@ function handlePotentialLinkEvent(node: TextNode, selection: BaseSelection, edit
return;
}
const cursorPoint = selectionRange[0].offset - 1;
const cursorPoint = selectionRange[0].offset;
const nodeText = node.getTextContent();
const rTrimText = nodeText.slice(0, cursorPoint);
const priorSpaceIndex = rTrimText.lastIndexOf(' ');