Quote: Fix new quote, transform from list block #2349
Merged
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#map
in itssave
implementation. While we could add a default value to the attributes definition, the approach here instead drops theArray#map
since, 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
toBrDelimitedContent
utility was not prepared to handle these cases.Lastly, the List -> Quote transform was not transforming into the expected
value
type 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: