-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try: Custom save serializer, Editable as array tree #4049
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!-- wp:image --> | ||
<figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2018/01/Dec-08-2017-15-12-24-17-300x137.gif" alt="" /></figure> | ||
<figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2018/01/Dec-08-2017-15-12-24-17-300x137.gif" /></figure> | ||
<!-- /wp:image --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!-- wp:image --> | ||
<figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2018/01/Dec-08-2017-15-12-24-17-300x137.gif" alt="" /></figure> | ||
<figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2018/01/Dec-08-2017-15-12-24-17-300x137.gif" /></figure> | ||
<!-- /wp:image --> | ||
|
||
<!-- wp:image --> | ||
<figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2018/01/Dec-05-2017-17-52-09-9-300x248.gif" alt="" /></figure> | ||
<figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2018/01/Dec-05-2017-17-52-09-9-300x248.gif" /></figure> | ||
<!-- /wp:image --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,9 +120,7 @@ export const settings = { | |
|
||
return ( | ||
<blockquote className={ `align${ align }` }> | ||
{ value && value.map( ( paragraph, i ) => | ||
<p key={ i }>{ paragraph.children && paragraph.children.props.children }</p> | ||
) } | ||
{ value.map( ( paragraph ) => paragraph.children ) } | ||
{ citation && citation.length > 0 && ( | ||
<cite>{ citation }</cite> | ||
) } | ||
|
@@ -145,9 +143,7 @@ export const settings = { | |
|
||
return ( | ||
<blockquote className={ `align${ align }` }> | ||
{ value && value.map( ( paragraph, i ) => | ||
<p key={ i }>{ paragraph.children && paragraph.children.props.children }</p> | ||
) } | ||
{ value.map( ( paragraph ) => paragraph.children ) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's unfortunate that this still means that the block author needs to be aware of the editable value structure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, in this case this is the structure from the block attribute's |
||
{ citation && citation.length > 0 && ( | ||
<footer>{ citation }</footer> | ||
) } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`createTinyMCEElement should render a TinyMCE element 1`] = ` | ||
<p | ||
a-prop="hi" | ||
> | ||
<p> | ||
Child | ||
</p> | ||
</p> | ||
Array [ | ||
"p", | ||
Object { | ||
"a-prop": "hi", | ||
}, | ||
Array [ | ||
Array [ | ||
"p", | ||
Object {}, | ||
Array [ | ||
"Child", | ||
], | ||
], | ||
], | ||
] | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!-- wp:core/audio {"align":"right"} --> | ||
<figure class="wp-block-audio alignright"> | ||
<audio controls="" src="https://media.simplecast.com/episodes/audio/80564/draft-podcast-51-livePublish2.mp3"></audio> | ||
<audio controls="true" src="https://media.simplecast.com/episodes/audio/80564/draft-podcast-51-livePublish2.mp3"></audio> | ||
</figure> | ||
<!-- /wp:core/audio --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!-- wp:audio {"align":"right"} --> | ||
<figure class="wp-block-audio alignright"><audio controls="" src="https://media.simplecast.com/episodes/audio/80564/draft-podcast-51-livePublish2.mp3"></audio></figure> | ||
<figure class="wp-block-audio alignright"><audio controls="true" src="https://media.simplecast.com/episodes/audio/80564/draft-podcast-51-livePublish2.mp3"></audio></figure> | ||
<!-- /wp:audio --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!-- wp:code --> | ||
<pre class="wp-block-code"><code>export default function MyButton() { | ||
return <Button>Click Me!</Button>; | ||
return <Button>Click Me!</Button>; | ||
}</code></pre> | ||
<!-- /wp:code --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!-- wp:image --> | ||
<figure class="wp-block-image"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="" /></figure> | ||
<figure class="wp-block-image"><img src="https://cldup.com/uuUqE_dXzy.jpg" /></figure> | ||
<!-- /wp:image --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use
window.Node
here.