Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit c77b8c9

Browse files
Zyntondmo-odoo
authored andcommitted
[IMP] Link: preserve link after line break
1 parent 125ae0d commit c77b8c9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/plugin-link/src/LinkFormat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ModifierLevel } from '../../core/src/Modifier';
55
export class LinkFormat extends Format {
66
preserveAfterNode = false;
77
preserveAfterParagraphBreak = false;
8+
preserveAfterLineBreak = true;
89
level = ModifierLevel.HIGH;
910

1011
constructor(url = '#', target = '') {

packages/plugin-link/test/Link.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ describePlugin(Link, testEditor => {
109109
contentAfter: '<p>a<a href="url">label</a>b<br>c[]d</p>',
110110
});
111111
});
112+
it('should insert a <br> inside a link', async () => {
113+
await testEditor(BasicEditor, {
114+
contentBefore: '<p><a href="url">a[]b</a></p>',
115+
stepFunction: async editor => {
116+
await insertLineBreak(editor);
117+
},
118+
contentAfter: '<p><a href="url">a<br>[]b</a></p>',
119+
});
120+
});
112121
});
113122
describe('range not collapsed', () => {
114123
it('should set the link on two existing characters and loose range', async () => {

0 commit comments

Comments
 (0)