-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix(NcRichText): modify MENTION_START regex to work on older MobileSafari versions #5976
fix(NcRichText): modify MENTION_START regex to work on older MobileSafari versions #5976
Conversation
251ebea
to
f7ea735
Compare
To add: I manually edited the minified JS on one of the instances I administer to the new regex pattern and the forms issue I linked is resolved! |
Failed tests show that a whitespace (which is now a part of matching group) is trimmed |
Roger roger, will fix. |
f7ea735
to
6bba2d8
Compare
Tests now pass with this new iteration. It's using positive lookaheads which have been supported in MobileSafari since the beginning. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookahead_assertion |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5976 +/- ##
==========================================
- Coverage 38.62% 37.86% -0.77%
==========================================
Files 142 148 +6
Lines 4958 5261 +303
Branches 1497 1577 +80
==========================================
+ Hits 1915 1992 +77
- Misses 2954 3185 +231
+ Partials 89 84 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked test examples with both regex rules, seems to return the same matching groups now. Thanks for the contribution!
Could you try to pull the latest master and rebase your PR on it? Codecov shouldn't be triggered here
…ions Fixes RichText causes errors on WebKit | Invalid regex nextcloud-libraries#5589 This regex performs the same function as the one used before, but does not make use of negative lookbehinds and therefore should work on older MobileSafari versions. Co-authored-by: Maksim Sukharev <antreesy.web@gmail.com> Signed-off-by: Arthur Rosa <arthur@rosafamily.net>
1879c1a
to
38d3afe
Compare
/backport to next |
Thanks for rebasing! Glad I could help sort this out. It was affecting forms users on one of the instances I manage. |
Hello can I manually modify files? |
It is already fixed since a couple of versions, where do you experience this issue? |
Fixes RichText causes errors on WebKit | Invalid regex #5589
This regex performs the same function as the one used before, but does not make use of negative lookbehinds and therefore should work on older MobileSafari versions.
To test, I looked first at the original mentioned regex from nextcloud server to get an idea of what the intended valid and invalid captures were. I tested both the original and modified regexes for both the server one and the one used in this component to verify that the matching groups were the same. The overall match 1 (blue highlight) is slightly different however the capture group 1 (green highlight) has the same content across both so this should be compatible.
☑️ Resolves
🖼️ Screenshots
🏁 Checklist
next
requested with a Vue 3 upgrade