singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 839 forks source link

fix: allow all correct URLs to be formatted #2328

Closed orevial closed 1 month ago

orevial commented 1 month ago

Description

Quill editor has a rule named AutoFormatMultipleLinksRule that auto format HTTP(s) links, however there was a small caveat where path was mandatory if characters others than A-Z were used.

The problem is that the URL can contain fragments and query params without requiring an extra / as per RFC 3986 on URL structure:

scheme://host[:port][/path][?query][#fragment]

Examples of what the rule was handling before the fix:

Proposed PR allows query params and fragments to be used even without a / character beforehand, thus respecting what the RFC is stating.

Also, I removed the non-prefixed URL from the comments because as opposed to what what was said, it didn't work:

/// It works for the following testing URLs:
// www.google.com 
EchoEllet commented 1 month ago

Thanks for your contributions.

orevial commented 4 weeks ago

LGTM.

Does this PR fix #2326 or any related issues in the repo?

Nope, but to me issue #2326 is not an actual problem we want to solve, see my comment.