-
Notifications
You must be signed in to change notification settings - Fork 499
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 part #361: HTML formatting throughout app #404
Conversation
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.
LGTM, just nit changes.
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.
Can you please add tests for this new logic?
I'm also looking for some more context on this trimming behavior that's being added. It's not exactly clear to me how to solves the problem (in fact, adding tests could help clarify that since they should run the code through the usual/expected happy paths).
Iam unassigning me once the changes are implemented please assign me again. |
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.
As discussed via chat, please remove the loops such that we’re only removing the first or last newline, rather than all first or last newlines. We can avoid the loops by updating the newline replace pattern added in #454 with one that replaces all variable newlines with one, eg: “\n{2,}” to solve the case of “\n\n\n” becoming “\n”.
|
||
if (text.endsWith("\n")) { | ||
text = text.substring(0, text.length - 1) | ||
trimEnd += 2 |
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.
Workaround.
Changed loop to if statement in trimSpannable() method. I tried replacing “\n{2,}” it didnt workout for me I tried workaround on this |
Fix part of #361. |
Explanation
This PR fixes Html Formatting in the following cases.