Cretezy / flutter_linkify

Turns text URLs and emails into clickable inline links in text for Flutter
https://pub.dartlang.org/packages/flutter_linkify
MIT License
262 stars 99 forks source link

Link placeholder / custom name #127

Open tomekit opened 8 months ago

tomekit commented 8 months ago

It would be great to have syntax (or similar):

[docs](https://example.com)

which would allow to provide custom name for the link. E.g.: docs

Possibly related: https://github.com/Cretezy/flutter_linkify/issues/124

tomekit commented 8 months ago

Potentially these regexes could be used: https://davidwells.io/snippets/regex-match-markdown-links

/* Match only links that are fully qualified with https */
const fullLinkOnlyRegex = /^\[([\w\s\d]+)\]\((https?:\/\/[\w\d./?=#]+)\)$/

/* Match full links and relative paths */
const regex = /^\[([\w\s\d]+)\]\(((?:\/|https?:\/\/)[\w\d./?=#]+)\)$/