matrix-org / matrix-rich-text-editor

Matrix Rich Text Editor
https://matrix-org.github.io/matrix-rich-text-editor/
Apache License 2.0
84 stars 20 forks source link

Don't trim NBSP chars at the end of a container #865

Closed jmartinesp closed 8 months ago

jmartinesp commented 8 months ago

This was causing crashes with state restoration on Android, since something like this:

<b>test</b>&nbsp;|

When restored, would look like:

<b>test</b>

But the selection would be kept at the same index, so when trying to apply it to the underlying UI the apps would crash.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7836f40) 87.43% compared to head (3a568ec) 89.40%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #865 +/- ## ============================================ + Coverage 87.43% 89.40% +1.97% ============================================ Files 165 118 -47 Lines 18840 16845 -1995 Branches 1033 635 -398 ============================================ - Hits 16472 15061 -1411 + Misses 2074 1760 -314 + Partials 294 24 -270 ``` | [Flag](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `78.78% <ø> (+7.55%)` | :arrow_up: | | [uitests-android](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `?` | | | [uitests-ios](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `78.78% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `88.03% <100.00%> (+2.49%)` | :arrow_up: | | [unittests-android](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `?` | | | [unittests-ios](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `75.15% <ø> (+0.25%)` | :arrow_up: | | [unittests-rust](https://app.codecov.io/gh/matrix-org/matrix-rich-text-editor/pull/865/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org) | `89.35% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=matrix-org#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 8 months ago

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