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

Feature auto link #204

Merged
merged 6 commits into from
Jun 8, 2021
Merged

Conversation

lucywang000
Copy link
Collaborator

@lucywang000 lucywang000 commented Jun 7, 2021

Fix #186

@lucywang000 lucywang000 requested a review from kepta June 7, 2021 03:53
Copy link
Collaborator

@kepta kepta left a comment

Choose a reason for hiding this comment

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

Looks great !

}
const [_, leadingSpace, text, scheme] = match;
// If no scheme, use default scheme http://
const href = scheme ? text : `http://${text}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we make it default to https?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are quite some website that are http only (e.g. corporate-internal websites). And for most https sites they would redirect http requests to https anyway.

@lucywang000
Copy link
Collaborator Author

@kepta I just updated the tld regexp, also handled a corner case (see the last commit)

@lucywang000 lucywang000 merged commit d63de47 into bangle-io:master Jun 8, 2021
@lucywang000 lucywang000 deleted the feature-auto-link branch June 8, 2021 01:25
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.

Convert URL's to links
2 participants