-
Notifications
You must be signed in to change notification settings - Fork 110
remove old link when editing #5690
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
remove old link when editing #5690
Conversation
|
The current change works well when only changing a single link in a paragraph. Link in a paragraphFind more information on https://nextcloud.com as usual. -> should only change the link. Link with custom text-> should only change the href. |
10bfdeb to
35f1d07
Compare
max-nextcloud
left a comment
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.
As I said earlier... this will not work if the link is not the only thing in a paragraph.
@grnd-alt would you be up for picking this up again?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5690 +/- ##
==========================================
+ Coverage 51.84% 51.90% +0.06%
==========================================
Files 475 475
Lines 40132 40157 +25
Branches 983 989 +6
==========================================
+ Hits 20805 20845 +40
+ Misses 19222 19207 -15
Partials 105 105 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d52b7f4 to
e8281df
Compare
max-nextcloud
left a comment
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.
Looks good. Just one small remark about the test code.
e8281df to
3db7595
Compare
3db7595 to
a333bb3
Compare
a333bb3 to
1813f94
Compare
Looked odd, restarted cypress |
max-nextcloud
left a comment
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.
Just a minor comment. Other than that seems good code wise. Have not tested it though.
| it('should insert new link if none at anchor', () => { | ||
| const editor = createCustomEditor( | ||
| '<p><a href="nextcloud.com">Test</a> HELLO WORLD</p>', | ||
| [Link], | ||
| ) | ||
| editor.commands.setTextSelection(10) | ||
| expect(editor.getJSON()).toEqual({ | ||
| content: [ | ||
| { | ||
| content: [ | ||
| { | ||
| marks: [ | ||
| { attrs: { href: 'nextcloud.com', title: null }, type: 'link' }, | ||
| ], | ||
| text: 'Test', | ||
| type: 'text', | ||
| }, | ||
| { text: ' HELLO WORLD', type: 'text' }, | ||
| ], | ||
| type: 'paragraph', | ||
| }, | ||
| ], | ||
| type: 'doc', | ||
| }) | ||
| }) |
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.
This test seems incomplete. It does not change anything but just asserts the initial state.
Signed-off-by: grnd-alt <[email protected]>
Signed-off-by: Max <[email protected]>
It is a proper e2e test driving the ui. Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
This way we do not hand in the active state and avoid inconsistencies. Signed-off-by: Max <[email protected]>
Signed-off-by: grnd-alt <[email protected]>
Signed-off-by: grnd-alt <[email protected]>
Signed-off-by: grnd-alt <[email protected]>
139fce4 to
08a528b
Compare
|
Failing psalm test is unrelated. I'd be okay with force merging. |
Fixes #5516