flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

[BUG] Illegal RegExp in Safari in 3.0.0-beta.1 and beta.2

Open sdabet-orpheo opened this issue 2 years ago • 12 comments

Describe the bug: Since I upgraded from 3.0.0-alpha6 to beta2, I have an issue on old Safari versions. The Html widget renders as a gray area and I see in the console the error:

FormatException: Illegal RegExp pattern (SyntaxError: Invalid regular expression: invalid group specifier name)
(?<=\n) *

HTML to reproduce the issue: Any HTML content

Html widget configuration: No specific configuration

Expected behavior: HTML properly rendered, instead of gray area.

Screenshots:

Device details and Flutter/Dart/flutter_html versions: iOS 12.5.5, flutter_html 3.0.0-beta.2

Stacktrace/Logcat

FormatException: Illegal RegExp pattern (SyntaxError: Invalid regular expression: invalid group specifier name)
(?<=\n) *

Additional info:

A picture of a cute animal (not mandatory but encouraged)

sdabet-orpheo avatar Jun 13 '23 08:06 sdabet-orpheo

I am also experiencing this issue. This issue seems to arise because Safari doesn't support lookbehind assertion.

bsubash2054 avatar Jun 15 '23 15:06 bsubash2054

To clarify, is this happening on MacOS Safari, or just on iOS?

Sub6Resources avatar Jun 16 '23 12:06 Sub6Resources

@Sub6Resources I just experienced it on iOS

sdabet-orpheo avatar Jun 16 '23 12:06 sdabet-orpheo

@Sub6Resources Its occurring on MacOs too.

bsubash2054 avatar Jun 16 '23 16:06 bsubash2054

I'm experiencing the same thing. It works great on Mac (Chrome and Safari), on android (chrome, firefox) but not on iOS Safari

aalloul avatar Jun 27 '23 12:06 aalloul

I'm experiencing same issue on MAC (Safari). image

harismairaj avatar Jul 03 '23 13:07 harismairaj

Same issue here any fixes or workarounds ?

Toolenaar avatar Jul 14 '23 12:07 Toolenaar

@Toolenaar use the package locally and comment out the code that is using the regex : (?<=\n)

flutterdev06 avatar Jul 14 '23 12:07 flutterdev06

I can confirm that simply commenting the faulting line in whitespace.dart fixes the issue. Cheers @flutterdev06!

NicolasDionB avatar Sep 19 '23 16:09 NicolasDionB

In case it helps other people: I have found this issue as well on ^3.0.0-alpha.3. I don't see it on the latest versions of iOS (17.4.x), but I spun up a simulator with iOS 16.2 and could see it there.

stefanhk31 avatar Apr 27 '24 12:04 stefanhk31