Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Safari #37

Closed
larryrobinson opened this issue Oct 7, 2022 · 4 comments
Closed

Bug in Safari #37

larryrobinson opened this issue Oct 7, 2022 · 4 comments

Comments

@larryrobinson
Copy link

larryrobinson commented Oct 7, 2022

The RegEx for doing pattern matches in easy_rich_text does not work in the Safari browser. Below is the code sample that blows up Safari and I've also attached a screen shot of the error message in the browser.

`

Widget instructions() {
return Padding(
padding: const EdgeInsets.only(left: 0, right: 0),
child: EasyRichText(
"Below are the menu images that have been uploaded. Select one and then click items.",
defaultStyle: instructionStyle,
patternList: [
EasyRichTextPattern(
targetString: 'items',
style: instructionStyle.copyWith(fontWeight: FontWeight.bold),
),
],
),
);
}

`

Screen Shot 2022-10-07 at 12 02 26 PM

@2000calories
Copy link
Owner

Currently, the core function of EasyRichText requires lookbehind in Regex. However Safari does not support lookbehind. I could add an option to skip the lookbehind to avoid the error. But most of EasyRichText 's functions will be lost.
#9

@larryrobinson
Copy link
Author

larryrobinson commented Oct 9, 2022

I suspected this was the case. I think people have been asking the Safari team to enable look behind since at least 2018. We've had to rewrite some of our RegEx statements to not use look behind and that makes RegEx even more unpalatable than it already is.

I appreciate the offer for adding an option but that negates all the great functionality of the package. We will find another way to get done what we need. Thanks for all your work and support on EasyRichText. It's a really nice package.

Feel free to close this issue. Thanks again!

@iabdousd
Copy link

Hey @larryrobinson, did you find a way to fix this?

@larryrobinson
Copy link
Author

@iabdousd Unfortunately not. As I mentioned above Safari's implementation of RegEx doesn't do look behind and EasyRichText relies on it to work properly. We ended reverting back to Flutter's Rich Text control which works great across all browsers but the code is more verbose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants