Description
flutter_link_previewer fails to detect full URLs when the path or query contains underscore (_).
Example: YouTube Live URLs are truncated during parsing.
This causes incorrect preview data and broken link previews in production apps.
Steps to reproduce
- Use LinkPreview with the following text:
https://www.youtube.com/live/wFTD_Tm9als?si=w99NseYI2KIDz7_Z
- Observe the detected link in onLinkPreviewDataFetched
Actual behavior
The detected URL is truncated:
https://www.youtube.com/live/wFTD_
Expected behavior
The full URL should be detected:
https://www.youtube.com/live/wFTD_Tm9als?si=w99NseYI2KIDz7_Z
Root cause
The internal regex used to detect links does not allow underscore (_) in the final path/query segment.