Caret misbehaves when merging nodes in useLexicalTextEntity #7454
Unanswered
codingedgar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following regex to highlight durations (exactly like the hastashs plugin):
/(?:(^|\s))((?:\d+:)?[0-5]?\d:[0-5]\d)/it matches
1:00and1:00:00but the caret misbehaves
expected:
1:00:00|actual:
1:00|:00I think is this line of code:
lexical/packages/lexical-text/src/registerLexicalTextEntity.ts
Line 86 in 354d077
But there are no tests, so I'm not sure what is the use of that line, is it safe to remove it? or is there any logic I'm missing?
I know the error does not happen if I change my regex to
/(?:(^|\s))((?:\d+:)?[0-5]?\d:[0-5]\d)(?=\s|$)/Which matches
1:00but not 1:00:so it its a node and then its text and then a node again, but if I have a node that merges the caret changes
paragraph:
1:00:0 ->1:00:00Beta Was this translation helpful? Give feedback.
All reactions