-
Notifications
You must be signed in to change notification settings - Fork 157
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
[Part 1] Port Auto Link #2479
[Part 1] Port Auto Link #2479
Conversation
@@ -1,7 +1,7 @@ | |||
import { getObjectKeys } from 'roosterjs-content-model-dom'; | |||
|
|||
/** | |||
* @internal | |||
* Data of the matched link | |||
*/ | |||
export interface LinkData { |
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.
Move this to roosterjs-content-model-types/lib/parameters
@@ -27,6 +40,8 @@ export type AutoFormatOptions = { | |||
const DefaultOptions: Required<AutoFormatOptions> = { | |||
autoBullet: true, | |||
autoNumbering: true, | |||
autoUnlink: true, |
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.
Suggest set autoUnlink to false by default since we didn't use it
break; | ||
} | ||
} | ||
} | ||
|
||
private handleContentChangedEvent(editor: IEditor, event: ContentChangedEvent) { | ||
const { autoLink } = this.options; |
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.
The original auto link feature also work when press SPACE or ENTER
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 see you put it in part 2. that is ok.
Port
AutoLink
andUnlinkWhenBackspaceAfterLink
content edit features intoAutoFormatPlugin
After porting
AutoLink
,AutoFormatPlugin
will handle automatically create link from pasted url segments, and after portingUnlinkWhenBackspaceAfterLink
, will automatically remove the link of text segment, if backspace key is pressed when the cursor is after a link.Another PR will be created to handle AutoLink while typing.