-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1b398e
commit c1b2a9d
Showing
5 changed files
with
15 additions
and
220 deletions.
There are no files selected for viewing
15 changes: 8 additions & 7 deletions
15
packages/roosterjs-content-model-plugins/lib/autoFormat/link/createLink.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
packages/roosterjs-content-model-plugins/lib/autoFormat/link/getLinkSegment.ts
This file was deleted.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
packages/roosterjs-content-model-plugins/lib/autoFormat/link/unlink.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { getLinkSegment } from './getLinkSegment'; | ||
import { formatTextSegmentBeforeSelectionMarker } from '../../pluginUtils/formatTextSegmentBeforeSelectionMarker'; | ||
|
||
import type { IEditor } from 'roosterjs-content-model-types'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function unlink(editor: IEditor, rawEvent: KeyboardEvent) { | ||
editor.formatContentModel(model => { | ||
const link = getLinkSegment(model); | ||
if (link?.link) { | ||
link.link = undefined; | ||
formatTextSegmentBeforeSelectionMarker(editor, (_model, linkSegment, _paragraph) => { | ||
if (linkSegment?.link) { | ||
linkSegment.link = undefined; | ||
rawEvent.preventDefault(); | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
174 changes: 0 additions & 174 deletions
174
packages/roosterjs-content-model-plugins/test/autoFormat/link/getLinkSegmentTest.ts
This file was deleted.
Oops, something went wrong.