-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Parsing: Replace server serialization by parsed outerHTML #3545
Conversation
c77be3b
to
4c538fb
Compare
This is good work and I can clearly see places where it's going to be useful. Do we think the most valuable about put is the block contents plus the block delimiters themselves though? What are the reasons for leaving those comment in vs. just returning everything inside the delimiters? (I know one is that it's easier in the parser to return the entire match than just the inside contents) |
Yes, part of the objective here is that we want to preserve block content as-is without serializing anything. In the latter case, we would still need to serialize the comment attributes again. Another example is that validation becomes stricter (in a good way), verifying not only the contents within the delimiters, but the delimiters themselves (a few flagged issues fixed in these changes). If we were to just return everything inside the delimiters, what then would be the main difference between |
Actually I'm curious about how this accomplishes our goals in creating and operating over blocks, not specifically in how to test Gutenberg's code. If On that note, why isn't This is an entirely separate question though from whether it's right to prevent WordPress from serializing and reprinting the blocks. It seems obvious to me that by making the client-side JavaScript necessary to operate on the post content we've been inviting trouble, and that to me is a bigger culprit here. |
@aduth what do you need to keep this moving? are there updates that affect its relevancy? |
@dmsnell Yes, this may no longer be the direction I want to take here, and rather move wpautop handling to occur in the client when loading an existing post, which has a few advantages:
|
Superseded by #4005 |
Related: #2806
Relies on: nylen/phpegjs#3 (changes manually effected here, but will be lost in future parser revisions)
This pull request seeks to change the behavior of selective
wpautop
application, simplifying the behavior to preserving the original markup of block content returned from the parser, rather than reserializing the parsed block node. In particular, this will be necessary for block nesting since, as implemented, the server is not capable of reserializing blocks with nested blocks if the block's save behavior is implemented on the client.Testing instructions:
Ensure that tests pass:
Repeat testing instructions from #2806