Skip to content

Commit

Permalink
Use div in text columns. (#3438)
Browse files Browse the repository at this point in the history
  • Loading branch information
samikeijonen authored and youknowriad committed Jan 4, 2018
1 parent 80f5f34 commit d01a464
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions blocks/library/text-columns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ registerBlockType( 'core/text-columns', {
/>
</InspectorControls>
),
<section className={ `${ className } align${ width } columns-${ columns }` } key="block">
<div className={ `${ className } align${ width } columns-${ columns }` } key="block">
{ times( columns, ( index ) =>
<div className="wp-block-column" key={ `column-${ index }` }>
<Editable
Expand All @@ -102,20 +102,20 @@ registerBlockType( 'core/text-columns', {
/>
</div>
) }
</section>,
</div>,
];
},

save( { attributes } ) {
const { width, content, columns } = attributes;
return (
<section className={ `align${ width } columns-${ columns }` }>
<div className={ `align${ width } columns-${ columns }` }>
{ times( columns, ( index ) =>
<div className="wp-block-column" key={ `column-${ index }` }>
<p>{ content && content[ index ].children }</p>
</div>
) }
</section>
</div>
);
},
} );
4 changes: 2 additions & 2 deletions blocks/test/fixtures/core__text-columns.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- wp:core/text-columns {"width":"center"} -->
<section class="wp-block-text-columns aligncenter columns-2">
<div class="wp-block-text-columns aligncenter columns-2">
<div class="wp-block-column">
<p>One</p>
</div>
<div class="wp-block-column">
<p>Two</p>
</div>
</section>
</div>
<!-- /wp:core/text-columns -->
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core__text-columns.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"columns": 2,
"width": "center"
},
"originalContent": "<section class=\"wp-block-text-columns aligncenter columns-2\">\n <div class=\"wp-block-column\">\n <p>One</p>\n </div>\n <div class=\"wp-block-column\">\n <p>Two</p>\n </div>\n</section>"
"originalContent": "<div class=\"wp-block-text-columns aligncenter columns-2\">\n <div class=\"wp-block-column\">\n <p>One</p>\n </div>\n <div class=\"wp-block-column\">\n <p>Two</p>\n </div>\n</div>"
}
]
2 changes: 1 addition & 1 deletion blocks/test/fixtures/core__text-columns.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"width": "center"
},
"innerBlocks": [],
"innerHTML": "\n<section class=\"wp-block-text-columns aligncenter columns-2\">\n <div class=\"wp-block-column\">\n <p>One</p>\n </div>\n <div class=\"wp-block-column\">\n <p>Two</p>\n </div>\n</section>\n"
"innerHTML": "\n<div class=\"wp-block-text-columns aligncenter columns-2\">\n <div class=\"wp-block-column\">\n <p>One</p>\n </div>\n <div class=\"wp-block-column\">\n <p>Two</p>\n </div>\n</div>\n"
},
{
"attrs": {},
Expand Down
4 changes: 2 additions & 2 deletions blocks/test/fixtures/core__text-columns.serialized.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- wp:text-columns {"width":"center"} -->
<section class="wp-block-text-columns aligncenter columns-2">
<div class="wp-block-text-columns aligncenter columns-2">
<div class="wp-block-column">
<p>One</p>
</div>
<div class="wp-block-column">
<p>Two</p>
</div>
</section>
</div>
<!-- /wp:text-columns -->

0 comments on commit d01a464

Please sign in to comment.