From 6a68c1b94fc07a9748da905fa80cfeea45d96792 Mon Sep 17 00:00:00 2001 From: Geoff Kimball Date: Mon, 7 Mar 2016 13:55:09 -0800 Subject: [PATCH] When
tag is processed, add the class 'center' instead of overwriting the whole class attribute --- lib/componentFactory.js | 6 +++--- test/components.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/componentFactory.js b/lib/componentFactory.js index 8b90801..550a28b 100644 --- a/lib/componentFactory.js +++ b/lib/componentFactory.js @@ -80,9 +80,9 @@ module.exports = function(element) { //
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', ''); diff --git a/test/components.js b/test/components.js index 68de07b..fbe8523 100644 --- a/test/components.js +++ b/test/components.js @@ -159,7 +159,7 @@ describe('Callout', () => { var expected = ` - +
`; @@ -172,7 +172,7 @@ describe('Callout', () => { var expected = ` - +
`;