diff --git a/src/routes/_components/status/StatusPoll.html b/src/routes/_components/status/StatusPoll.html index 4ab0943d..93258fd5 100644 --- a/src/routes/_components/status/StatusPoll.html +++ b/src/routes/_components/status/StatusPoll.html @@ -4,7 +4,7 @@ {#each options as option}
  • - {option.share}% {@html option.title} + {option.share}% {@html cleanTitle(option.title)}
    {@html option.title} + {@html cleanTitle(option.title)}
  • {/each} @@ -362,6 +362,14 @@ this.set({ choices: choices }) } }, + helpers: { + cleanTitle (title) { + // Remove newlines and tabs. + // Mastodon UI doesn't care because in CSS it's formatted to be single-line, but we care + // if people somehow insert newlines, because it can really mess up the formatting. + return (title && title.replace(/[\n\t]+/g, ' ')) || '' + } + }, components: { SvgIcon }