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

feat: if data has URL display it as hyperlink #140

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

medjedovicm
Copy link

Resolves #131, resolves #132

Implementation

  • New segment type introduced link
  • Path or URL is detected and appropriate CSS is applied. (purple colour, text underlined)
  • In such case, the segment is clickable
  • When clicked, output event is fired: segmentLinkClicked payload is type string containing the clicked segment value

Copy link

@RamonHaugLand RamonHaugLand left a comment

Choose a reason for hiding this comment

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

Minor comment but I also want the feautre.

private isLink(value: string): boolean {
return value.substring(0, 8) === 'https://' ||
value.substring(0, 7) === 'http://' ||
value[0] === '/'

Choose a reason for hiding this comment

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

What if this is changed to a RegExp, the scheme is not case sensitive, and is also posible http:(domain)
Reference

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I was delayed a bit. I pushed and would appreciate your review.

@medjedovicm
Copy link
Author

image

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.

If data has url how to display it as link (Hyperlink) Displaying hyperlinks
3 participants