Skip to content
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

Auto link enhancements #2798

Merged
merged 8 commits into from
Sep 23, 2024
Merged

Auto link enhancements #2798

merged 8 commits into from
Sep 23, 2024

Conversation

juliaroldi
Copy link
Contributor

Add to new options of auto transformation, automatically transform telephone numbers and email addresses in hyperlink. This change adds two new options autoTel and autoMailto.

autoLinkEnhance


/**
* @internal
*/
export function createLink(editor: IEditor) {
export function createLink(
editor: IEditor,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use an option object instead of multiple parameters. You can create an option type for createLink, then let AutoFormatOptions extend from it.

interface AutoLinkOptions {
  autoLink?: boolean; 
 ...
}

interface AutoFormatOptions extends AutoLinkOptions {
  ...
}

*/
export function getLinkUrl(
text: string,
shouldLink: boolean,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -12,12 +12,15 @@ import type {
export function createLinkAfterSpace(
previousSegment: ContentModelText,
paragraph: ShallowMutableContentModelParagraph,
context: FormatContentModelContext
context: FormatContentModelContext,
autoLink: boolean,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@juliaroldi juliaroldi merged commit e3bc1f3 into master Sep 23, 2024
7 checks passed
@juliaroldi juliaroldi deleted the u/juliaroldi/link-enhancements branch September 23, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants