Skip to content
Snippets Groups Projects
Commit d41c9a71 authored by lain's avatar lain
Browse files

Polls: Construct an html field during normalization.

parent 7de56a80
No related branches found
No related tags found
2 merge requests!12172.1.0 into master,!1146Polls: Construct an html field during normalization.
Pipeline #27220 passed
......@@ -17,7 +17,7 @@
<span class="result-percentage">
{{ percentageForOption(option.votes_count) }}%
</span>
<span>{{ option.title }}</span>
<span v-html="option.title_html"></span>
</div>
<div
class="result-fill"
......@@ -75,6 +75,12 @@
@import '../../_variables.scss';
.poll {
img.emoji {
vertical-align: middle;
object-fit: contain;
width: 32px;
height: 32px;
}
.votes {
display: flex;
flex-direction: column;
......
......@@ -258,6 +258,12 @@ export const parseStatus = (data) => {
output.summary_html = addEmojis(escape(data.spoiler_text), data.emojis)
output.external_url = data.url
output.poll = data.poll
if (output.poll) {
output.poll.options = (output.poll.options || []).map(field => {
field.title_html = addEmojis(field.title, data.emojis)
return field
})
}
output.pinned = data.pinned
output.muted = data.muted
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment