-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
markdown: support formatted link text #5149
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanк you!
@@ -176,7 +177,7 @@ function getTextSibling(node: TextNode, backward: boolean): TextNode | null { | |||
if (!sibling) { | |||
const parent = node.getParentOrThrow(); | |||
|
|||
if (parent.isInline()) { | |||
if (parent.isInline() && !$isLinkNode(parent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, is there a better way than special-casing LinkNode?
This creates a dependency on @lexical/link, which is less than ideal. it might be necessary here though.
@fantactuka thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would still be a special case, but I can break the dependency by inlining the test of parent.getType() === "link"
or similar.
Thinking about expanding beyond that.. would it be ok to remove the code that continues formatting spans across Element nodes & always create boundaries on either side of consecutive spans of Text Nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been using this change in production for 6 months and been happy with it. What needs to be done to get this upstream @acywatson ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objection to this now. If we get the CI passing again, I'll merge it
What is missing to this PR to get it merged? |
Rebased on main |
Hi @robfig, seems like there are failing tests. Do you think you could review this? |
Hi, I looked at the failing tests and realized that the approach I took does lead to that functionality being changed/broken (I forget which exactly). It didn't seem like something which would be easy to fix, so I lost steam |
Closing this PR due to staleness! If there are new updates, please reopen the PR. |
Fixes #5148