From deb95ef1231398943fdca1f8aaf1c56f3e9ff559 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Mon, 15 Dec 2014 10:19:18 -0500 Subject: [PATCH] Removing duplicate elements from charset --- src/js/parser/javascript/charset.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/parser/javascript/charset.js b/src/js/parser/javascript/charset.js index 3045b30..7f39174 100644 --- a/src/js/parser/javascript/charset.js +++ b/src/js/parser/javascript/charset.js @@ -6,13 +6,21 @@ export default _.extend({}, Base, { type: 'charset', _render() { + var elements = _.unique(this.parts.elements, part => { + if (part.literal) { + return part.literal.textValue; + } else { + return part.textValue; + } + }); + this.partContainer = this.container.group(); - return Q.all(_.map(this.parts.elements, (part => { + return Q.all(_.map(elements, (part => { return part.render(this.partContainer.group()); }).bind(this))) .then((() => { - this.spaceVertically(this.parts.elements, { + this.spaceVertically(elements, { padding: 5 });