-
Notifications
You must be signed in to change notification settings - Fork 230
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
Changed linkification on paste to match URL parsing within the linkification reaction (Resolves #2031) #2045
Conversation
…ication reaction (Resolves #2031)
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.
LGTM
// Type text with two URLs | ||
await tester.typeImeText("https://www.google.com and https://flutter.dev "); |
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.
Please end the comment with a dot.
// Place the caret at the beginning of the empty document. | ||
await tester.placeCaretInParagraph("1", 0); | ||
|
||
// Paste text with a URL |
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.
Please end the comment with a dot.
await tester.pressCtlV(); | ||
} | ||
|
||
// Ensure the URL is linkified |
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.
Please end the comment with a dot.
// Place the caret at the beginning of the empty document. | ||
await tester.placeCaretInParagraph("1", 0); | ||
|
||
// Paste text with a URL |
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.
Please end the comment with a dot.
await tester.pressCtlV(); | ||
} | ||
|
||
// Ensure the URL is linkified |
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.
Please end the comment with a dot.
…ication reaction (Resolves superlistapp#2031) (superlistapp#2045)
Changed linkification on paste to match URL parsing within the linkification reaction (Resolves #2031)
Linkification when pasting content wasn't recognizing URLs without www and https. This is because we have two different linkification paths. One for pasting, which happens at the moment the text is pasted. Another for reacting to user input.
This PR alters the existing pasting behavior to match the link extraction of the linkification reaction.
I'd like to move linkification entirely into the reaction, but it's not completely clear how to determine whether or not the user pasted the content vs got it some other way. I filed a proposal to add such details to all changes: #2044
This PR solves the problem without doing a much larger refactor as described in that proposal.