2000calories / flutter_easy_rich_text

The EasyRichText widget provides an easy way to use RichText.
https://pub.dev/packages/easy_rich_text
MIT License
80 stars 33 forks source link

Not working on Web Safari #44

Closed iabdousd closed 1 year ago

iabdousd commented 1 year ago

There's an error with Web on the Safari browser, the error is that Safari doesn't support lookbehind assertions in regex and the package seems to rely on them inside of easy_rich_text.dart (EasyRichText.processString()).

1. Show the EasyRichText widget code. targetString and example text are must.

EasyRichText(
  'Lorem ipsulm ...',
  patternList: [
    EasyRichTextPattern(
      targetString: EasyRegexPattern.webPattern,
      style: TextStyle(color: Colors.blue),
    ),
  ],
)

2. Show the flutter doctor output.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.7, on macOS 13.2.1 22D68 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.76.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!
2000calories commented 1 year ago

37

Currently, the core function of EasyRichText requires lookbehind. If Safari is a must, you need to find another way to make it done.

iabdousd commented 1 year ago

Thanks for your rapid response!