You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'd like to improve on that logic and reuse the isEditedPostDirty selector from the gutenberg store.
However there are a few road blocks along the way:
parse and serialize of blocks isn't always symmetric. For instance:
>serialize(parse(`<!-- wp:heading {"align":"center"} --><h2 style="text-align:center;">Welcome to Gutenberg!</h2><!-- /wp:heading -->`))`<!-- wp:heading {"align":"center"} --><h2 style="text-align:center">Welcome to Gutenberg!</h2><!-- /wp:heading -->`
(notice the ; at the end of text-align:center)
Some blocks are updated when the post loads. For instance paragraph and heading both use the RichText component and modify the attributes in onContentSizeChange. But onContentSizeChange is called on load by RCTAztecView (RichText underline component).
The text was updated successfully, but these errors were encountered:
Currently we detect if a post is modified by checking if the resulting html changed:
See:
#225
#242
#264
We'd like to improve on that logic and reuse the
isEditedPostDirty
selector from the gutenberg store.However there are a few road blocks along the way:
parse
andserialize
of blocks isn't always symmetric. For instance:(notice the
;
at the end oftext-align:center
)paragraph
andheading
both use theRichText
component and modify the attributes inonContentSizeChange
. ButonContentSizeChange
is called on load byRCTAztecView
(RichText underline component).The text was updated successfully, but these errors were encountered: