diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 index 32434b52e..a57195303 100644 --- a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 @@ -112,7 +112,9 @@ export default Ember.Controller.extend({ output += `${pollHeader}\n`; if (pollOptions.length > 0 && !isNumber) { - output += `${pollOptions.split("\n").map(option => `* ${option}`).join("\n")}\n`; + pollOptions.split("\n").forEach(option => { + if (option.length !== 0) output += `* ${option}\n`; + }); } output += '[/poll]'; diff --git a/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 b/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 index 02c4ad8d0..fe263538c 100644 --- a/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 +++ b/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 @@ -210,7 +210,7 @@ test("multiple pollOutput", function() { isMultiple: true, pollType: controller.get("multiplePollType"), pollMin: 1, - pollOptions: "1\n2" + pollOptions: "\n\n1\n\n2" }); equal(controller.get("pollOutput"), "[poll type=multiple min=1 max=2]\n* 1\n* 2\n[/poll]", "it should return the right output");