Quote: Fix new quote, transform from list block#2349
Merged
Conversation
Should have same result, unless we were explicitly trying to strip props from root p node, in which case this is not assigned in quote block implementation, and should be the responsibility of the transform source to remove in transform value
Member
Author
|
Oh failing tests, you illuminate why we'd done the map, though really shouldn't be necessary facebook/react#7038. |
Needed to ensure key is assigned into map result to avoid React error. Seems unnecessary since we don't need the diffing reconciliation for generating static markup, but alas. See: facebook/react#7038
Codecov Report
@@ Coverage Diff @@
## master #2349 +/- ##
=========================================
+ Coverage 24.69% 24.7% +0.01%
=========================================
Files 152 152
Lines 4738 4962 +224
Branches 799 849 +50
=========================================
+ Hits 1170 1226 +56
- Misses 3014 3136 +122
- Partials 554 600 +46
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2343
This pull request seeks to resolve issues relating to quote initialization and list transforms.
The quote block does not define a default value but assumes it to be an array, iterating by
Array#mapin itssaveimplementation. While we could add a default value to the attributes definition, the approach here instead drops theArray#mapsince, for all I could discern, it serves no purpose (generates identical output). Instead, the value is rendered verbatim.Further, there were some issues with list transforms, particularly for lists which do not contain any special formatting or list nesting. In these cases, list items would be plain strings, but the block's internal
toBrDelimitedContentutility was not prepared to handle these cases.Lastly, the List -> Quote transform was not transforming into the expected
valuetype of quote and should have been wrapped in the expected array of paragraphs.Testing instructions:
Verify that you can create a new Quote block.
Verify that you can convert from List block to Quote (and Paragraph) block with: