diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-06 05:35:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 05:35:52 +0100 |
commit | fd128b9c7aa5c71adbfc2e223212514c0baee675 (patch) | |
tree | f88c6d60286250b7d77c1f545330eda2849cdd04 /app/javascript/mastodon/components/poll.js | |
parent | 57643557b64bc1853c4aeb65fc652dac3467fa18 (diff) |
Fix poll options not rendering text after vote/refresh (#10189)
* Fix poll options not rendering text after vote/refresh * Fix poll options not showing up on public pages * Fix code style issue
Diffstat (limited to 'app/javascript/mastodon/components/poll.js')
-rw-r--r-- | app/javascript/mastodon/components/poll.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/poll.js b/app/javascript/mastodon/components/poll.js index c52445c86..bfff7b601 100644 --- a/app/javascript/mastodon/components/poll.js +++ b/app/javascript/mastodon/components/poll.js @@ -7,6 +7,8 @@ import classNames from 'classnames'; import { vote, fetchPoll } from 'mastodon/actions/polls'; import Motion from 'mastodon/features/ui/util/optional_motion'; import spring from 'react-motion/lib/spring'; +import escapeTextContentForBrowser from 'escape-html'; +import emojify from 'mastodon/features/emoji/emoji'; const messages = defineMessages({ moments: { id: 'time_remaining.moments', defaultMessage: 'Moments remaining' }, @@ -120,7 +122,7 @@ class Poll extends ImmutablePureComponent { {!showResults && <span className={classNames('poll__input', { checkbox: poll.get('multiple'), active })} />} {showResults && <span className='poll__number'>{Math.round(percent)}%</span>} - <span dangerouslySetInnerHTML={{ __html: option.get('title_emojified') }} /> + <span dangerouslySetInnerHTML={{ __html: option.get('title_emojified', emojify(escapeTextContentForBrowser(option.get('title')))) }} /> </label> </li> ); |