Skip to content
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

HTML Block: Fix parsing HTML blocks using html instead of children #1484

Merged
merged 1 commit into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions blocks/library/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import './style.scss';
import { registerBlockType, query } from '../../api';
import BlockControls from '../../block-controls';

const { children } = query;
const { html } = query;

registerBlockType( 'core/html', {
title: __( 'Custom HTML' ),
Expand All @@ -28,7 +28,7 @@ registerBlockType( 'core/html', {
className: false,

attributes: {
content: children(),
content: html(),
},

edit: class extends Component {
Expand Down
12 changes: 1 addition & 11 deletions blocks/test/fixtures/core-html.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,7 @@
"uid": "_uid_0",
"name": "core/html",
"attributes": {
"content": [
{
"children": "Some HTML code",
"type": "h1"
},
"\n",
{
"children": "This text will scroll from right to left",
"type": "marquee"
}
]
"content": "<h1>Some HTML code</h1>\n<marquee>This text will scroll from right to left</marquee>"
}
}
]