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

Fix reconciliate mechanism after multiple new lines #705

Merged

Conversation

aringenbach
Copy link
Contributor

@aringenbach aringenbach commented Jun 5, 2023

Should fix element-hq/element-ios#7570

Fixes an issue with the reconciliate mechanism that was inserting replacement characters in the wrong position after multiple newlines. It was due to its blind filtering of ZWSP placeholders that don't always match.

Now the actual HTML chars are computed for comparison which makes the results of StringDiffer directly match the position in the Rust model.

Also this change fixes a few SwiftFormat issues.

@aringenbach aringenbach added the iOS label Jun 5, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jun 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2023

Codecov Report

Patch coverage: 97.56% and project coverage change: +1.86 🎉

Comparison is base (70a2fbf) 88.22% compared to head (5d5570e) 90.09%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #705      +/-   ##
============================================
+ Coverage     88.22%   90.09%   +1.86%     
============================================
  Files           144      109      -35     
  Lines         16633    15340    -1293     
  Branches        762      551     -211     
============================================
- Hits          14674    13820     -854     
+ Misses         1773     1502     -271     
+ Partials        186       18     -168     
Flag Coverage Δ
uitests 84.16% <97.56%> (+9.15%) ⬆️
uitests-android ?
uitests-ios 84.16% <97.56%> (+0.28%) ⬆️
unittests 88.77% <97.56%> (+1.03%) ⬆️
unittests-android ?
unittests-ios 78.69% <97.56%> (+1.22%) ⬆️
unittests-rust 89.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ces/WysiwygComposer/Extensions/ComposerModel.swift 87.50% <ø> (ø)
...WysiwygComposerView/WysiwygComposerViewModel.swift 94.29% <87.50%> (+0.20%) ⬆️
...MLParser/Extensions/NSAttributedString+Range.swift 98.96% <100.00%> (+0.26%) ⬆️
...LParser/Extensions/NSMutableAttributedString.swift 94.80% <100.00%> (+0.06%) ⬆️
...siwygComposer/Sources/HTMLParser/Replacement.swift 100.00% <100.00%> (ø)
...r/Sources/WysiwygComposer/Tools/StringDiffer.swift 88.70% <100.00%> (+11.78%) ⬆️

... and 36 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aringenbach aringenbach requested a review from a team June 5, 2023 15:56
Copy link
Contributor

@jonnyandrew jonnyandrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@aringenbach aringenbach merged commit cfda115 into main Jun 6, 2023
@aringenbach aringenbach deleted the aringenbach/fix-reconciliate-after-multiple-new-lines branch June 6, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using RTE, when typing words containing an apostrophe, letters are unexpectedly replaced with a single quote.
3 participants