Skip to content

Commit

Permalink
When <center> tag is processed, add the class 'center' instead of ove…
Browse files Browse the repository at this point in the history
…rwriting the whole class attribute
  • Loading branch information
gakimball committed Mar 7, 2016
1 parent dc79e9b commit 6a68c1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/componentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ module.exports = function(element) {
// <center>
case this.components.center:
if (element.children().length > 0) {
element.children().attr({
align: 'center', class: 'center'
});
element.children()
.attr('align', 'center')
.addClass('center');
}

element.attr('data-parsed', '');
Expand Down
4 changes: 2 additions & 2 deletions test/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('Callout', () => {
var expected = `
<table>
<tr>
<th class="callout"></th>
<td class="callout"></td>
</tr>
</table>
`;
Expand All @@ -172,7 +172,7 @@ describe('Callout', () => {
var expected = `
<table>
<tr>
<th class="callout primary"></th>
<td class="callout primary"></td>
</tr>
</table>
`;
Expand Down

0 comments on commit 6a68c1b

Please sign in to comment.