Cretezy / linkify

Low-level link (text, URLs, emails) parsing library in Dart
https://pub.dartlang.org/packages/linkify
MIT License
62 stars 50 forks source link

Escape character \r causes any URLs after it not to become hyperlinked #20

Closed Atreto76 closed 3 years ago

Atreto76 commented 4 years ago

When a \r escape character is in the string given to the Linkify widget, anything after that escape character does not become a clickable hyperlink. This is a problem as I'm getting information from an API but the data returned contains \r\n for newlines (which is a common escape character sequence). A workaround is to simply remove all \r escape characters from the string but there wasn't any indication that was needed.

Example: Note: onOpen code has been omitted for simplicity. No \r Linkify( text: 'https://www.google.com\nhttps://www.google.com', ) This code works fine as it does not contain \r. Has \r Linkify( text: 'https://www.google.com\r\nhttps://www.google.com', ) This code will cause only the first URL to become hyperlinked. The second one will not become hyperlinked as it is after the \r escape character. Using looseURL does not resolve the issue. screenshot

This may be the same issue as Cretezy/flutter_linkify#47 but I cannot say for sure as the source string is not provided.

Cretezy commented 4 years ago

Will address, moving to parsing library

Cretezy commented 3 years ago

This has been resolved with #26 in https://github.com/Cretezy/linkify/commit/63e97d597518509baf60b90e44ef828096902e69