-
Notifications
You must be signed in to change notification settings - Fork 121
Detect change in html editor #704
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
Conversation
|
We should update current test cases for |
|
Yes, good call about adding tests @daniloercoli , will do. And thanks for the quick pointer! |
|
Not quite sure I'm testing this PR in the right way, but starting the demo app, and switching to HTML editor results in
|
|
Hmm, I do see |
|
Made to fixes @daniloercoli :
|
|
@daniloercoli pointed out that priming the source editor from the visual editor is not a good idea from a developer's point of view so, I reverted that commit. Instead, with 3e1b4cb I changed the mode toggling logic to only re-set an editor's text if the other editor is reporting changes. |
|
LGTM, made a comment on the WPAndroid PR that might be worth considering implementing on this side of the world (i.e. adding a utility method to |
Fix #703
This is a follow up PR to #674, extending the idea of using a hash-based mechanism to detect when the html (source) editor has user-initiated changes in comparison to the original content.
This functionality is needed by wpandroid to properly update a post remotely when the editor is in html mode.
A key detail in this implementation is that now, the source editor's
displayStyledAndFormattedHtml()method requires a boolean flag to be passed, effectively adopting the "content dirty" flag from the visual editor.Test
No test steps available.