FIX: poll builder should ignore empty lines

Although pollOptionsCount skips empty lines, pollOutput inserts empty
lines. Skip them instead.

Signed-off-by: Loic Dachary <loic@dachary.org>
This commit is contained in:
Loic Dachary
2016-07-14 09:10:31 +02:00
parent 304f7040a3
commit f152900969
2 changed files with 4 additions and 2 deletions

View File

@ -111,7 +111,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]';